[C#] UserControl : Inconsistent accessibility 에러

이걸 팁이라고 올릴만한 것인지는 모르겠지만,

다음과 같은 클래스 두개를 작성했을 때 에러가 난다.

class QClass
    {
          .... 어쩌구 저쩌구
    }


public partial class QControl : UserControl
{
        public QClass m_qClass;
       .... 어쩌구 저쩌구
}

Error 1 Inconsistent accessibility: property type 'SelfTest.QClass' is less accessible than property 'SelfTest.QControl.qClass' C:\Documents and Settings\junn\My Documents\Visual Studio 2008\Projects\SelfTest\SelfTest\QControl.cs 16 23 SelfTest

이런 에러 메세지의 대부분은 제한자를 잘못써서 나는 오류인데

UserControl을 상속받는 클래스에서 partial을 뺄 수도 없는 노릇이고 변수 정의시에 QClass를 public을 빼면 외부에서 접근이 안되고,

이땐 그냥

public class QClass
{
.....
}

로 바꿔주니 되더라.

partial은 대체 무슨 역할인지, C#은 편하긴 한데 아직 잘 모르겠다.

2009/06/26 18:00 2009/06/26 18:00
JUNN
Programming 2009/06/26 18:00

트랙백 주소 : http://www.junn.net/tt/trackback/325

댓글을 달아 주세요

[로그인][오픈아이디란?]

Powerd by Textcube,designed by criuce, Revised by JUNN