This documentation is archived and is not being maintained.

Compiler Error CS5001 

Error Message

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

This error occurs when no Main method 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, or not declaring Main as static.


The following example generates CS5001.

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