Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The argument to the 'attribute' attribute must be a valid identifier
Any argument that you pass to the ConditionalAttribute or IndexerNameAttribute attributes must be a valid identifier. This means that it may not contain characters such as "+" that are illegal when they occur in identifiers.
Example
This example illustrates CS0633 using the ConditionalAttribute. The following sample generates 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() { }
}
This example illustrates CS0633 using the 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; }
}
}