我知道对这个问题有很多疑问,但我的问题最糟糕.我有一个包含很多WPF应用程序的大项目.错误的是我已经删除了App.xaml,现在我在构建中有错误.我尝试的是采取备份App.xaml,甚至当我再次将它放在我的项目中时,我仍然遇到此错误.该怎么办 ?谢谢.
Luc*_*ski 13
在文件属性中,将Build Action设置为ApplicationDefinition:

这将Main在中间输出文件(obj/App.g.cs)中为您生成一个方法:
/// <summary>
/// Application Entry Point.
/// </summary>
[System.STAThreadAttribute()]
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
public static void Main() {
YourAppName.App app = new YourAppName.App();
app.InitializeComponent();
app.Run();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5085 次 |
| 最近记录: |