Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
631 views
in Technique[技术] by (71.8m points)

c# - How to fix WPF error: "Program does not contain a static 'Main' method suitable for an entry point"?

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

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

I made no changes to project properties, just added some classes, moved some other classes into folders. Its an WPF Application project so it should be all OK. Entry point is where it should be, file App.xaml was not modified at all :(

What should I do to make it work again?

NOTE
For reference: if renaming the App.xaml this can happen. As OP stated, App.xaml was not altered; however, this is added for anyone that does rename the App.xaml.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...