c# - “does not contain a static '主要' method”错误

标签 c# compiler-errors

在程序上运行Windows应用程序时出现以下错误。有人可以帮忙吗?

Error: Program 'C:\Users\Owner\Documents\Visual Studio 2008\Projects\Project1\Integer Division\Integer Division\obj\Debug\Integer Division.exe' does not contain a static 'Main' method suitable for an entry point Integer Division

最佳答案

您需要具备以下条件:

static void Main()
{
}

如果您想“运行”某个东西,则需要一个主电源。这基本上是主要功能,因为名称暗示了程序将在何处运行。您应该查找其中包含main()的任何类示例,然后将您的代码放入其中(用于整数除法的代码?)。

关于c# - “does not contain a static '主要' method”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14018681/

相关文章:

c - 错误 : conflicting types for ‘wstat’ in gcc

visual-c++ - c_src\bcrypt_nif.c(94): error C2275: 'ERL_NIF_TERM' : illegal use of this type as an expression

python - 为什么 Python 编译这段代码没有抛出错误?

c# - 发送草稿邮件时 Outlook SendUsingAccount 为空

c# - 如何跨 MVC 站点共享通用样式信息(css、图像等)?

c# - 在 WPF 中调整 dataGrid 大小的网格

compiler-errors - 使用 OpenModelica v1.14.1(64 位)编译简单的 Modelica 代码时出现多个未声明的标识符错误

c# - ASP.Net WebApi MapHttpRoute 适用于 Visual Studio,但不适用于 WebForm 应用程序中的 IIS

c# - 如何将自定义 EndPointBehavior 添加到服务的 web.config 中?

tensorflow - 为什么在发生错误后重新运行一行后,Jupyter Notebook会停止执行?