欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > asp.net >内容正文

asp.net

WPF error: does not contain a static 'Main' method suitable for an entry point

发布时间:2025/7/14 asp.net 64 豆豆
生活随笔 收集整理的这篇文章主要介绍了 WPF error: does not contain a static 'Main' method suitable for an entry point 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

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

在Visual Studio中删除App.xaml从别的位置拷贝一个后会出现的编译错误,原因在于

默认的App.xaml在属性页中的Build Action 是ApplicationDefinition,而拷贝过来的文件默认不是这样的。这个Build Action 会为我们生成所需的静态Main方法,这样程序就能够正确的被编译了。

 

refrence:

http://joewirtley.blogspot.com/2008/04/application-class-and-main-method-in.html

 

类似的移植性错误一般和Build Action相关,仔细查看

总结

以上是生活随笔为你收集整理的WPF error: does not contain a static 'Main' method suitable for an entry point的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。