WPF类加载错误?添加自定义类时崩溃

Sea*_*red 3 wpf runtime-error class

弹出

An unhandled exception of type 'System.IO.IOException' occurred in
PresentationFramework.dll

Additional information: Cannot locate resource 'mainwindow.xaml'.
Run Code Online (Sandbox Code Playgroud)

输出日志

'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).
Run Code Online (Sandbox Code Playgroud)

每次我尝试将C#类添加到项目时都会发生这种情况.它是WPF,当我开始一个新项目时,它只会在窗口运行良好.在我尝试向应用程序添加实际功能的那一刻,它就像这样吹嘘我.(哦,它构建,它构建得足够公平 - 这是一个运行时错误.)即使我删除了类,应用程序仍然无法正常运行.笏呢?

任何帮助表示赞赏.

前进的方法有很多种,但只有一种方法可以保持不变. - 罗斯福

编辑:如果你想看看回购,它就在这里.

H.B*_*.B. 5

附加信息:找不到资源'mainwindow.xaml'.

你的App.xaml:

<Application x:Class="markless.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
Run Code Online (Sandbox Code Playgroud)

问题不是添加任何类,而是删除/重命名MainWindow仍然在这里引用.