Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0580

Visual Studio .NET 2003

Too many unnamed arguments to attribute 'attribute'

The number of unnamed arguments is not correct for the attribute. See the definition of the attribute and pass the correct arguments. For more information, see Attributes.

The following sample generates CS0580:

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

public class bug
{
   [IndexerName("abc", "def")]   // CS0580
   // name attribute takes one unnamed string parameter
   // try the following line instead
   // [IndexerName("abc")]
   public int this [int index]
   {
      get
      {
         return 0;
      }
   }

   public static void Main()
   {
   }
}
Show:
© 2014 Microsoft