Export (0) Print
Expand All
Expand Minimize

Compiler Error CS0516

Constructor 'constructor' can not call itself

A program cannot recursively call constructors.

The following sample generates CS0516:

// CS0516.cs
namespace x
{
   public class clx
   {
      public clx() : this()   // CS0516, delete "this()"
      {
      }

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