Share via


컴파일러 오류 CS0633

업데이트: 2007년 11월

오류 메시지

'attribute' 특성에 대한 인수에는 올바른 식별자를 사용해야 합니다.
The argument to the 'attribute' attribute must be a valid identifier

ConditionalAttribute 또는 IndexerNameAttribute 특성에 전달하는 인수는 모두 올바른 식별자여야 합니다. 즉, 식별자에서 사용하지 말아야 하는 "+"와 같은 문자로 인해 오류가 발생할 수도 있습니다.

예제

이 예제에서는 ConditionalAttribute를 사용하여 CS0633 오류가 발생하는 경우를 보여 줍니다. 다음 샘플에서는 CS0633 오류가 발생하는 경우를 보여 줍니다.

// CS0633a.cs
#define DEBUG
using System.Diagnostics;
public class Test
{
   [Conditional("DEB+UG")]   // CS0633
   // try the following line instead
   // [Conditional("DEBUG")]
   public static void Main() { }
}

이 예제에서는 IndexerNameAttribute를 사용하여 CS0633 오류가 발생하는 경우를 보여 줍니다.

// CS0633b.cs
// compile with: /target:module
#define DEBUG
using System.Runtime.CompilerServices;
public class Test
{
   [IndexerName("Invalid+Identifier")]   // CS0633
   // try the following line instead
   // [IndexerName("DEBUG")]
   public int this[int i] 
   { 
      get { return i; } 
   }
}