Share via


컴파일러 오류 CS0592

업데이트: 2007년 11월

오류 메시지

'attribute' 특성은 이 선언 형식에서 사용할 수 없습니다. 'type' 선언에서만 사용할 수 있습니다.
Attribute 'attribute' is not valid on this declaration type. It is valid on 'type' declarations only.

특성을 의도하지 않은 선언에 적용했습니다.

예제

다음 샘플에서는 CS0592 오류가 발생하는 경우를 보여 줍니다.

// CS0592.cs
using System;

[AttributeUsage(AttributeTargets.Interface)]
public class MyAttribute : Attribute 
{
}

[MyAttribute]
public class A  // CS0592, MyAttribute is not valid for a class
{
    public static void Main()
    {
    }
}