如何设置Visual Studio显示堆栈跟踪的第一次机会异常?

问题描述:

现在,它只显示:


类型为System.ArgumentException的第一次机会异常发生在Microsoft.Stubs.VsPackage .dll

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.Stubs.VsPackage.dll

有没有办法可以让它包含一个部分堆栈跟踪与异常消息,而不必打破调试器?

Is there a way I can get it to include a partial stack trace with the exception message without having to break into the debugger?

您是否在输出窗口或异常助理中看到此消息?

Are you seeing this message in the output window or in the exception assistant?

异常助手是一个显示异常信息的小工具提示样式窗口。如果是例外,您可以点击查看详细信息按钮并打开属性网格。其中一个属性将是堆栈跟踪。

The exception assistant is a little tooltip style window which displays the exception information. If it's the exception assitant you can click on the "View Detail" button and bring up a property grid. One of the properties will be the Stack Trace.

如果是构建窗口,我恐怕没有办法打印出堆栈跟踪信息,例外。您只能选择启用第一次机会异常中断,并手动检查该值。

If it's the build window I'm afraid there is no way to have it print out the stack trace information with the exception. You're only option is to enable break on first chance exceptions and manually inspect the value.