Warning: Undefined array key "REMOTE_USER" in /kieuns/www/lib/plugins/googleanalytics/action.php on line 61 language:csharp:에러 [GINS WIKI 긴스 위키] Warning: Undefined array key "stylesheets" in /kieuns/www/inc/StyleUtils.php on line 102

사용자 도구

사이트 도구


사이드바

카테고리

language:csharp:에러
Warning: Undefined array key "fperm" in /kieuns/www/inc/io.php on line 255 Warning: Undefined array key "fperm" in /kieuns/www/inc/io.php on line 255 Warning: Undefined array key "fperm" in /kieuns/www/inc/io.php on line 255

일관성 없는 액세스 가능성: 'xxx' 속성 형식이 'yyy' 속성보다 액세스 하기 어렵습니다.

에러 코드의 예

File A
namespace T1 {
  public class MainWindow {
    ASomeList mSomeList = new ASomeList(); // 에러(!)
    public ASomeList RealSomeList { get { return mSomeList; } }
  }
}
File B
namespace T1 {
  class ASomeList {
    // ...
  }
}

이유 : ASomeList 클래스가 public 이 아니다. c#에서는 클래스도 접근 권한이 있다는 걸 종종 까먹는다.

네임스페이스 내에서 직접 선언되는 클래스는 public 또는 internal 일 수 있다. 기본은 internal 이다.

language/csharp/에러.txt · 마지막으로 수정됨: 2024/04/23 22:44 (바깥 편집)