Compiler Error CS0132
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Error CS0132 

Error Message

'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
      {
      }
   }
}
Show:
© 2016 Microsoft