Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0132

'constructor' : a static constructor must be parameterless

A static constructor cannot be declared with one or more parameters. For more information, see Constructors (C# Programming Guide).

The following sample generates CS0132:

// CS0132.cs
namespace MyNamespace
{
   public class MyClass
   {
      public MyClass(int i)
      {
      }
   }

   public class MyClass2 : MyClass
   {
      static MyClass2(int i)   // CS0132
      {
      }
   }
}

Community Additions

ADD
Show:
© 2014 Microsoft