简体   繁体   English

错误 CS0111:“程序”类型已经定义了一个名为“Main”的成员,具有相同的参数类型 c#

[英]error CS0111: Type 'Program' already defines a member called 'Main with the same parameter types c#

当我运行代码时,在此处输入图像描述此 eroor 显示错误 CS0111:“程序”类型已经定义了一个名为“Main”的成员,具有相同的参数类型

The error is for tempCodeRunnerFile.cs.错误是针对 tempCodeRunnerFile.cs。 It must have Main .它必须有Main Program.cs already does. Program.cs 已经做到了。 And they both seem to be in same project.而且他们似乎都在同一个项目中。 It would make sense.这是有道理的。 I get error even in VS 2019 if two files have Main() in the same project.如果两个文件在同一个项目中具有 Main(),即使在 VS 2019 中我也会出错。

Based on update by OP Please remove One of the Main or include only one file in csproj.基于 OP 的更新,请删除Main文件之一或仅在 csproj 中包含一个文件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有 2 个错误,“开始”和“更新”错误 CS0111:类型“敌人”已经定义了一个名为“开始”的成员,具有相同的参数类型我该如何解决? - Got 2 errors with 'start' and 'update' error CS0111: Type 'Enemy' already defines a member called 'Start' with the same parameter types how can i fix? C#错误:类型'x'已经定义了一个名为'y'的成员,它具有相同的参数类型 - C# error: Type 'x' already defines a member called 'y' with the same parameter types C#:专用模板方法-错误:类型“…”已经定义了具有相同参数类型的成员“…” - C#: specialized template method - Error: Type '…' already defines a member called '…' with the same parameter types 已经定义了一个使用相同参数类型调用的成员 c# - already defines a member called with the same parameter types c# 类型'Startup'已经定义了一个名为'Configuration'的成员,它具有相同的参数类型 - Type 'Startup' already defines a member called 'Configuration' with the same parameter types 错误已使用相同的参数类型定义了一个名为“索引”的成员 - Error already defines a member called 'Index' with the same parameter types 错误 - 已经使用相同的参数类型定义了一个名为“InitializeComponent”的成员 - Error - already defines a member called 'InitializeComponent' with the same parameter types 错误1类型“ Pay”已经使用相同的参数类型定义了一个名为“ ComputePay”的成员 - Error 1 Type 'Pay' already defines a member called 'ComputePay' with the same parameter types 我该如何修复错误:Type Form1'已经定义了一个名为'Dispose'的成员,它具有相同的参数类型? - How can i fix the error: Type Form1' already defines a member called 'Dispose' with the same parameter types? Unity 中的错误 CS0111:已定义 Update() - error CS0111 in Unity: Update() is already defined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM