打破异常投掷 - 设置默认值 [英] Break on Exception Throw -- Setting the Default
问题描述
如何更改Visual Studio的默认值,以防止默认情况下中断访问冲突(例如)?我尝试过Debug-> Exceptions,但它只适用于每个解决方案(或每个项目?),而不是全局。
How do you change the defaults for Visual Studio, to tell it to break on access violations by default (for example)? I've tried Debug->Exceptions but it only works on a per-solution (or per-project?) basis, not globally.
谢谢!
推荐答案
默认值是关闭所有异常,并按照您所描述的方式为每个解决方案保存设置。
The default is for all the exceptions to be turned off and settings are saved per solution as you described.
http://msdn.microsoft.com/en -us / library / d14azbfh.aspx
您可以编写一个宏来为特定异常调用SetBreakWhenThrown()来为您启用一组默认异常设置。
You could write a macro to turn on a default set of exceptions for you by calling SetBreakWhenThrown() on specific exception settings.
http://msdn.microsoft.com/en-us/library/envdte90.exceptionsettings.setbreakwhenthrown.aspx
宏示例:
Dim eg As ExceptionSettings = CType(DTE.Debugger, Debugger3).ExceptionGroups.Item("Common Language Runtime Exceptions")
eg.SetBreakWhenThrown(True, eg.Item("System.AccessViolationException"))
这篇关于打破异常投掷 - 设置默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!