弹出
An unhandled exception of type 'System.IO.IOException' occurred in
PresentationFramework.dll
Additional information: Cannot locate resource 'mainwindow.xaml'.
输出日志
'markless.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'
...
'markless.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\PresentationFramework\v4.0_4.0.0.0__31bf3856ad364e35\PresentationFramework.dll'
The thread 'vshost.NotifyLoad' (0x6b0) has exited with code 0 (0x0).
The thread 'vshost.LoadReference' (0x1fa8) has exited with code 0 (0x0).
'markless.vshost.exe' (Managed (v4.0.30319)): Loaded 'T:\#_\Programming\GitHub\markless\src\win2\markless\bin\Debug\markless.exe', Symbols loaded.
Step into: Stepping over method without symbols 'markless.App.App'
'markless.vshost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll'
A first chance exception of type 'System.IO.IOException' occurred in PresentationFramework.dll
An unhandled exception of type 'System.IO.IOException' occurred in PresentationFramework.dll
Additional information: Cannot locate resource 'mainwindow.xaml'.
The program '[6268] markless.vshost.exe: Program Trace' has exited with code 0 (0x0).
The program '[6268] markless.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).
每次我尝试将 C# 类添加到我的项目时都会发生这种情况。它是 WPF,当我开始一个新项目时,它会运行良好的只是 window。当我尝试向应用程序添加实际功能的那一刻,它就像这样让我大吃一惊。(哦,它构建了,它构建得足够公平——这是一个运行时错误。)即使我随后删除了该类,应用程序仍然无法正确运行。做什么?
任何帮助表示赞赏。
前进的方式有很多种,但站稳脚跟的方式只有一种。- 罗斯福
编辑:如果你想查看 repo,就在这里。