Program does not contain a static 'Main' method suitable for an entry point

后端 未结 9 1129
心在旅途
心在旅途 2020-11-28 23:40

Suddenly my whole project stopped compiling at all, showing the following message:

Program \'path_to_obj_project_folder\' does not contain a static \'

相关标签:
9条回答
  • 2020-11-28 23:54

    You can also run into this if you're working on a WPF project that was started in VS 2010 (Beta 1), then moved into VS 2008.

    Under the project properties, the .NET framework version gets unset (since .NET 4.0 isn't valid in VS 2008), and for some reason that causes this error.

    If you set the .NET framework (e.g. to .NET 3.5), the error goes away.

    0 讨论(0)
  • 2020-11-28 23:55

    I have got the same error but then I found out that I typed small m instead of capital M in Main method

    0 讨论(0)
  • 2020-11-29 00:01

    Project Properties \ Output file -> Select Class Library :)

    0 讨论(0)
  • 2020-11-29 00:01

    As what, I guess pixparker wanted to say, but remained to be not clear enough, for me at least, do ensure that... All "Other Projects" have an "Output Type" of "Class Library" selected while... Only "One Project" being selected as either "Window Application" or "Console Application" output.

    0 讨论(0)
  • 2020-11-29 00:04

    Check the properties of App.xaml. Is the Build Action still ApplicationDefinition?

    0 讨论(0)
  • 2020-11-29 00:05

    In my case (after renaming application namespace manually) I had to reselect the Startup object in Project properties.

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