开发者

Break on Exception Throw -- Setting the Default

How do you change the defaults for Visual Studio, to tell it to break on acc开发者_如何学Cess violations by default (for example)? I've tried Debug->Exceptions but it only works on a per-solution (or per-project?) basis, not globally.

Thank you!


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

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

macro example:

Dim eg As ExceptionSettings = CType(DTE.Debugger, Debugger3).ExceptionGroups.Item("Common Language Runtime Exceptions")
eg.SetBreakWhenThrown(True, eg.Item("System.AccessViolationException"))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜