我不确定我在这里做错了什么。我试过了Console.Read();, Console.ReadLine();
,也没有。我也试过了Ctrl F5
。我在搜索时没有找到其他建议。如果相关,我正在使用 Visual Studio Express。显然,我想让程序说“Hello world!” 这是我的代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Miscellaneous
{
class Hello_World_
{
static void Main()
{
Console.WriteLine("Hello world!");
Console.Read();
}
}
}
错误 1 Program 'c:\Users\MyUserName\Desktop\Visual Studio Workspace\Miscellaneous\Miscellaneous\obj\Debug\Miscellaneous.exe' has more than one entry point defined: 'Miscellaneous.Hello_World_.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\MyUserName\Desktop\Visual Studio Workspace\Miscellaneous\Miscellaneous\Hello World!.cs 11 21 Miscellaneous
错误 2 Program 'c:\Users\MyUserName\Desktop\Visual Studio Workspace\Miscellaneous\Miscellaneous\obj\Debug\Miscellaneous.exe' has more than one entry point defined: 'Miscellaneous.Program.Main()'. Compile with /main to specify the type that contains the entry point. C:\Users\MyUserName\Desktop\Visual Studio Workspace\Miscellaneous\Miscellaneous\Program.cs 15 21 Miscellaneous