Compiler Error CS1558
'class' does not have a suitable static Main method
The MainEntryPoint compiler option specified a class in which to look for a Main method. However, the Main method was not defined correctly.
The following example generates CS1558 because of invalid return type.
C#
// CS1558.cs
// compile with: /main:MyNamespace.MyClass
namespace MyNamespace
{
public class MyClass
{
public static float Main()
{
return 0.0; // CS1558 because the return type is a float.
}
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
.NET is an open source project. Select a link to provide feedback: