Compiler Error CS0017

Program 'output file name' has more than one entry point defined. Compile with /main to specify the type that contains the entry point.

A program can only have one Main method.

To resolve this error, you can either delete all Main methods in your code, except one, or you can use the /main compiler option to specify which Main method you want to use.

The following sample generates CS0017:

// CS0017.cs
// compile with: /target:exe
public class clx
{
   static public void Main()
   {
   }
}

public class cly
{
   public static void Main()   // CS0017, delete one Main or use /main
   {
   }
}