简体   繁体   中英

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. It must have Main . Program.cs already does. 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.

Based on update by OP Please remove One of the Main or include only one file in csproj.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM