C# 运行时错误总是在清理生成后消失
我有一个WPF MVVM应用程序。当我第一次启动VisualStudio并在调试模式下运行应用程序时,会出现如下所述的异常。在干净的构建之后,应用程序运行良好,直到重新启动VisualStudio并再次运行C# 运行时错误总是在清理生成后消失,c#,wpf,C#,Wpf,我有一个WPF MVVM应用程序。当我第一次启动VisualStudio并在调试模式下运行应用程序时,会出现如下所述的异常。在干净的构建之后,应用程序运行良好,直到重新启动VisualStudio并再次运行 'The invocation of the constructor on type 'MyView' that matches the specified binding constraints threw an exception.' Line number '135' and line
'The invocation of the constructor on type 'MyView' that matches the specified binding constraints threw an exception.' Line number '135' and line position '8'.
{"Cannot locate resource 'views/myview.xaml'."}
MyView是一个用户控件,存在于正在搜索它的文件夹中,并包含在主项目中 这是一个虚假的例外,我认为这与找不到视图无关。我注意到,当我禁用我设置的自定义日志记录机制时,错误消失了,很可能是一个异常导致了这种情况