Troubleshooting “program does not contain a static 'Main' method” when it clearly does…?

后端 未结 14 1789
Happy的楠姐
Happy的楠姐 2020-11-30 08:39

My MS Visual C# program was compiling and running just fine. I close MS Visual C# to go off and do other things in life.

I reopen it and (before doing anything else)

相关标签:
14条回答
  • 2020-11-30 09:12

    Are the properties on the file set to Compile?

    0 讨论(0)
  • 2020-11-30 09:13

    For me same error occurred because I renamed the namespace of the Program class.
    The "Startup object" field in "Application" tab of the project still referenced the old namespace. Selecting new startup object solved the problem and also removed the obsolete entry from that list.
    You may also want to update "Default namespace" field in the same "Application" tab.

    0 讨论(0)
提交回复
热议问题