Share via


컴파일러 오류 CS1512

업데이트: 2007년 11월

오류 메시지

'base' 키워드는 현재 컨텍스트에서 사용할 수 없습니다.
Keyword 'base' is not available in the current context

base 키워드를 메서드, 속성 또는 생성자 외부에 사용했습니다.

다음 예제에서는 CS1512 오류가 발생하는 경우를 보여 줍니다.

// CS1512.cs
using System;

class Base {}

class CMyClass : Base
{
    private String xx = base.ToString();   // CS1512
    // Try putting this initialization in the constructor instead:
    // public CMyClass()
    // {
    //    xx = base.ToString();
    // }

    public static void Main()
    {
        CMyClass z = new CMyClass();
    }
}