错误& quot; Main& quot;声明 [英] error on "Main" statement

查看:115
本文介绍了错误& quot; Main& quot;声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试学习C#。 我下载了编译器&输入第一个示例程序。

Trying to learn C#. I downloaded the compiler & typed in the first sample program.

 我在以下声明中收到错误:

 I get an error on the statement of:

    public static void Main()

    public static void Main()

错误内容如下:

错误  1  Program'C:\ Users \ johni_000 \ Documents \ \\ Visual Studio 2008 \Projects\app\app\obj\Release\app.exe'不包含适用于入口点的静态"主要"方法  app

Error 1 Program 'C:\Users\johni_000\Documents\Visual Studio 2008\Projects\app\app\obj\Release\app.exe' does not contain a static 'Main' method suitable for an entry point app

有什么想法吗? 我只是复制了本书开头的那篇。

Any ideas?  I just copied the one in the beginning of the book.

推荐答案

嗨johni,

Hi johni,

欢迎来到MSDN论坛。

Welcome to MSDN forum.

1.您可以在这里分享一个简单的示例,以便我们直接为您查看。

1.Could you share a simple sample here so that we can check it directly for you.

2.And since你提到了第一个示例程序,请检查项目类型和代码结构。

2.And since you mentioned this a first sample program, please check the project type and the code structure.

尝试创建一个C#Console应用程序(.net框架),你可以找到C#的标准结构代码如下所示:

Try creating a C# Console App(.net framework), and you can find a standard structure of C# code looks like below:

之后,  F5开始没有调试或ctrl + F5开始debuging以查看程序的结果。

After that,  F5 to start without debugging or ctrl+F5 to start debuging to see the results of the program.

这是一个简单的控制台应用程序示例。您也可以分享有关项目类型的信息或截图,这里有一个简单的样本,我们会直接为您检查。

This is a simple example for console app. Also you can share info about project type or a screenshot for a simple sample which has this issue here, we will check it directly for you.

祝您学习愉快!期待您的回复。

Wish you a happy learning! Look forward to your reply.

最好的问候

Lance


这篇关于错误& quot; Main& quot;声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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