更新:2007 年 11 月

错误消息

“function declaration”的签名错误,不能作为入口点

Main 的方法声明无效:声明所使用的签名无效。Main 必须声明为静态的并且它必须返回 intvoid。有关更多信息,请参见 Main() 和命令行参数(C# 编程指南)

下面的示例生成 CS0028:

 复制代码
// CS0028.cs
// compile with: /W:4 /warnaserror
public class a
{
    public static double Main(int i)   // CS0028
    // Try the following line instead:
    // public static void Main()
    {
    }
}