如何修复 WPF 错误:“程序不包含适合入口点的静态 'Main' 方法"? [英] How to fix WPF error: "Program does not contain a static 'Main' method suitable for an entry point"?

查看:42
本文介绍了如何修复 WPF 错误:“程序不包含适合入口点的静态 'Main' 方法"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

突然我的整个项目完全停止编译,显示以下消息:

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

程序path_to_obj_project_folder"不包含静态Main"适合入口点的方法

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

我没有对项目属性进行任何更改,只是添加了一些类,将一些其他类移动到文件夹中.它是一个 WPF 应用程序项目,所以应该没问题.入口点是它应该在的地方,文件 App.xaml 根本没有被修改:(

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?

注意
供参考:如果重命名App.xaml,这可能会发生.正如 OP 所说,App.xaml 没有改变;但是,这是为任何重命名 App.xaml 的人添加的.

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.

推荐答案

检查 App.xaml 的属性.Build Action 仍然是 ApplicationDefinition 吗?

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

这篇关于如何修复 WPF 错误:“程序不包含适合入口点的静态 'Main' 方法"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆