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

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:
© 2016 Microsoft