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

Compiler Error CS5001

Program 'program' does not contain a static 'Main' method suitable for an entry point

This error occurs when no static Main method with a correct signature is found in the code that produces an executable file. This error also occurs if the entry point function, Main, is defined with the wrong case, such as lower-case main.

  • Main must be declared as static and it must return void or int, and it must have either no parameters or else one parameter of type string[].

The following example generates CS5001:

// CS5001.cs
// CS5001 expected
public class a
{
   // Uncomment the following line to resolve.
   // static void Main() {}
}
Show:
© 2016 Microsoft