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相关,仔细查看

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-04-27
  • 2021-07-16
  • 2022-01-21
  • 2021-08-10
  • 2021-09-28
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2021-05-18
  • 2022-01-01
  • 2021-05-08
  • 2022-12-23
相关资源
相似解决方案