在 Visual Studio 中获取有关已处理异常的更多详细信息(即时 Window)

Get more details about handled exceptions in Visual Studio (Immediate Window)

当 运行 VB.NET Winforms 应用程序在 Visual Studio 2015(调试模式)时,立即 Window 以这种方式显示有关处理异常的通知(它是葡萄牙语,但我觉得英文也没什么区别):

Exceção gerada: 'System.NullReferenceException' em MyApp.exe
Exceção gerada: 'System.NullReferenceException' em MyApp.exe
Exceção gerada: 'System.NullReferenceException' em MyApp.exe
Exceção gerada: 'System.NullReferenceException' em MyApp.exe
Exceção gerada: 'System.NullReferenceException' em MyApp.exe
Exceção gerada: 'System.NullReferenceException' em MyApp.exe

我的问题是:我可以调整一些设置,以便它也显示它的来源吗? (文件名和行号,或方法名,或两者皆有)

非常感谢。

我不能保证这是一个修复,因为我的葡萄牙语有限,但是有一个 window 称为异常设置,您通常可以使用 CTRL+ALT+E 调出它,其中有所有类型的复选框例外情况以及您的代码是否应该在它们发生时中断。

例如,找到一个名为 NullReferenceException 的异常并确保它已被选中,并且当异常被抛出时您的代码应该中断(gerada?)。

如果您在查找异常设置时遇到问题 window 请查看此问题的最佳答案 post:

Visual Studio 2015 break on unhandled exceptions not working