This documentation is archived and is not being maintained.

Compiler Error CS0633

The argument to the IndexerName attribute must be a valid identifier

Any argument that you pass to the IndexerName attribute must be a valid identifier.

The following sample generates CS0633:

// CS0633.cs
using System;
using System.Runtime.CompilerServices;

public class MonthDays
{
   [IndexerName("bad indexer name")]   // CS0633
   // try the following line instead
   // [IndexerName("badindexername")]
   public int this[int iPropIndex]
   {
      get
      {
         return 0;
      }
      set
      {
      }
   }
}

public class test
{
   public static void Main( string[] args )
   {
   }
}
Show: