VS 2017调试,错误异常

时间:2017-06-26 09:32:47

标签: wpf debugging visual-studio-2017

我有一个简单的.Net 4.5 WPF应用程序,并在VS2015和VS2017中进行调试。 VS2017给出了不明确的例外情况:

Mat src = new Mat("lenna.png", ImreadModes.GrayScale); // image does not exist

VS2015异常在右侧上升并且很明显:

An exception of type 'System.IO.FileNotFoundException' occurred in OpenCvSharp.dll but was not handled in user code

VS2017没有转到正确的cs行号并加注:

System.Windows.Markup.XamlParseException

我认为我的VS2017配置有问题吗?

1 个答案:

答案 0 :(得分:0)

这是Visual Studio设置问题。按 CTRL + ALT + E (或转到“调试” - >“Windows - >异常设置”)打开“异常设置”窗口确保在“投掷时中断”下检查System.IO.FileNotFoundException - >公共语言运行时异常。

使用Visual Studio中的调试器管理异常: https://docs.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger