This documentation is archived and is not being maintained.

Compiler Error CS0514

'constructor' : static constructor cannot have an explicit this or base constructor call

There is no object for a static class. Therefore, the base class cannot be called. Objects must be known at compile time.

The following sample generates CS0514:

// CS0514.cs
namespace x
{
   public class clx
   {
      public clx(int i)
      {
      }
   }

   public class cly : clx
   {
      static cly() : base(0)  // CS0514, remove base or static
      {
      }
   }
}

See Also

base

Show: