错误CS5001:exe不包含适用于入口点的静态“Main”方法

时间:2012-09-24 08:04:55

标签: c# macos mono xamarin.ios monodevelop

在尝试编译MonoTouch项目时,我突然开始收到以下错误。

  

错误CS5001:程序'MyApp.exe'不包含适用于入口点的静态'Main'方法(CS5001)(MyApp)

以下是我的Main.cs的样子。

using System;
using System.Collections.Generic;
using System.Linq;

using MonoTouch.Foundation;
using MonoTouch.UIKit;

namespace MyApp
{
    public class Application
    {
        static void Main (string[] args)
        {
            UIApplication.Main (args, null, "AppDelegate");
        }
    }
}

知道我可以做些什么来解决这个问题吗?或者我是否需要创建新的解决方案?

1 个答案:

答案 0 :(得分:-1)

也许你可能错过了STAThread:

[STAThread]
static void Main(string[] args)
{
 ...
}
相关问题