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

后端 未结 14 1818
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 08:58

    It is important that the Main method is placed in the class that is properly configured in Visual Studio as a start-up object:

    • Right-click your project in project explorer; choose "Properties..."
    • In the properties dialog, choose "Application" tab
    • In the application tab, choose SimpleAIMLEditor.Program from the drop-down for your start-up object

    Now run your application again. The error will disappear.

提交回复
热议问题