Error del compilador CS0633

Actualización: noviembre 2007

Mensaje de error

El argumento pasado al atributo 'atributo' debe ser un identificador válido
The argument to the 'attribute' attribute must be a valid identifier

Cualquier argumento que se pase a los atributos ConditionalAttribute o IndexerNameAttribute debe ser un identificador válido. Esto significa que no puede contener caracteres como "+" que no sean válidos cuando aparecen en identificadores.

Ejemplo

En este ejemplo se genera el error CS0633 mediante ConditionalAttribute. El código siguiente genera el error 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() { }
}

En este ejemplo se genera el error CS0633 mediante IndexerNameAttribute.

// 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; } 
   }
}