开发者

Turn on exception handling in visual studio 2010 by default for all projects

开发者 https://www.devze.com 2023-01-27 21:48 出处:网络
It seems that visual studio 2010 does not break on thrown exceptions by default for new projects - you have to go into the settings and turn that开发者_StackOverflow社区 behavior on. This setting seem

It seems that visual studio 2010 does not break on thrown exceptions by default for new projects - you have to go into the settings and turn that开发者_StackOverflow社区 behavior on. This setting seems to be a per-project setting, rather than a system-wide one.

Is there any way to force the default behavior to be to break on thrown exceptions for all new projects?

I am running Visual Studio 2010 Ultimate, on windows 7 Professional, on a 64 bit machine.


Assuming you mean the Debug\Exceptions... menu dialog to catch all first chance exceptions, this is global/system-wide.

(Note that like many global settings, I think its value is saved when VS shuts down, and so beware if you have multiple instances of VS open with different values for this setting.)


It's loaded first time from the Registry here (and after that persisted in the solution):

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio[VS version]\Configuration\AD7Metrics\Exception{449EC4CC-30D2-4032-9256-EE18EB41B62B}\Common Language Runtime Exceptions\[namespace]\[exception type name]

[VS Version] can be 9.0 or 10.0 or any other hive (like 9.0Exp if your running in VS 2008 SDK experimental hive)

[namespace] can be for example System and [exception type name] System.AppDomainUnloadedException.

Then you must setup the State key value (make it consistent with other existing exceptions configuration).

0

精彩评论

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

关注公众号