vs2022调试C#代码报错“application/xaml+xml”ContentType 无效。

用ilspy反编译了一个exe程序,用vs编译调试时报错,没有其它错误
引发的异常:“System.Exception”(位于 PresentationFramework.dll 中)
“System.Exception”类型的未经处理的异常在 PresentationFramework.dll 中发生
“application/xaml+xml”ContentType 无效。
System.Exception
HResult=0x80131500
Message=“application/xaml+xml”ContentType 无效。
Source=PresentationFramework
StackTrace:
在 System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
在 Demo.App.InitializeComponent() 在 E:\project\vscsproj\Demo\App.cs 中: 第 89 行

第89行

Uri resourceLocator = new Uri("/Demo;component/app.xaml", UriKind.Relative);
                Application.LoadComponent(this, resourceLocator);
阅读 1.6k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进