疑难解答“程序不包含静态‘Main’方法"当它清楚地...? [英] Troubleshooting "program does not contain a static 'Main' method" when it clearly does...?

查看:21
本文介绍了疑难解答“程序不包含静态‘Main’方法"当它清楚地...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 MS Visual C# 程序编译运行得很好.我关闭 MS Visual C# 去做其他事情.

My MS Visual C# program was compiling and running just fine. I close MS Visual C# to go off and do other things in life.

我重新打开它并(在做任何其他事情之前)转到发布"我的程序并收到以下错误消息:

I reopen it and (before doing anything else) go to "Publish" my program and get the following error message:

程序 C:myprogram.exe 不包含适合入口点的静态Main"方法

Program C:myprogram.exe does not contain a static 'Main' method suitable for an entry point

嗯?是的,它确实......而且它在 15 分钟前就开始工作了.当然,我可以相信我在关闭之前不小心撞到了什么或做了什么......但是什么?我该如何解决这个问题?

Huh? Yes it does... and it was all working 15 min earlier. Sure, I can believe that I accidentally hit something or done something before I closed it up... but what? How do I troubleshoot this?

我的 Program.cs 文件如下所示:

My Program.cs file looks like this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using System.Threading;

namespace SimpleAIMLEditor
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new mainSAEForm());
        }
    }
}

...那里有一些评论.没有其他错误.

...and there are some comments in there. There are no other errors.

帮助?

推荐答案

文件的属性是否设置为编译"?

Are the properties on the file set to Compile?

这篇关于疑难解答“程序不包含静态‘Main’方法"当它清楚地...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆