“Compile with /main to specify the type that contains the entry point.”

前端 未结 4 745
不思量自难忘°
不思量自难忘° 2021-02-08 06:20

Per the code below, I am getting the following message. I am fairly certain \"why\" I am getting it, I just don\'t know how to rearrange the code to move/remove/replace one of t

4条回答
  •  滥情空心
    2021-02-08 07:15

    If you are using Visual Studio to compile/debug your application you should set the entry point of your program in the properties of your project.
    First Page -> Application
    Startup object -> YourNameSpace.WindowsApplication1.Form1

    There is no need to rearrange the code for this. However, looking at the code provided, I can't see any point in which you start the Form1. Inside the Main method is missing the code that starts Form1. Something like

    Application.Run(new Form1());
    

提交回复
热议问题