是否有设置可以在捕获异常时向我显示? [英] Is there a setting to show me when an exception is caught?
问题描述
我正在从事一个编写了大量错误代码的项目.
I'm working on a project where a lot of bad code is written.
今天我遇到了一段捕获和异常的代码,只是返回一个空字符串来处理"它(非常难以调试).
Today I came across a piece of code that caught and exception and just returned an empty string to "handle" it (very difficult to debug).
我想知道是否有任何方法可以知道在 Visual Studio 2010 中抛出并捕获了异常?
I was wondering whether there was any way of knowing that an exception has been thrown and caught in visual studio 2010?
推荐答案
VS menu -> Debug -> Exceptions -> Enable CLR Exceptions(CTRL+ALT+E)
VS menu -> Debug -> Exceptions -> Enable CLR Exceptions (CTRL+ALT+E)
在那里你可以选择抛出"或用户未处理",显然你需要打破抛出"异常
There you can choose from "Thrown" or "user un-handled", obviously you need to break on "Thrown" exceptions
调试器可以在以下情况下立即中断应用程序的执行发生异常,让您有机会在之前调试异常一个处理程序被调用.
The debugger can break execution of your application immediately when an exception occurs, giving you a chance to debug the exception before a handler is invoked.
有关 MSDN 的更多详细信息:如何:在抛出异常时中断一个>
More details on MSDN: How to: Break When an Exception is Thrown
重要说明 - 此功能在 Visual StudioWeb Developer"版本中不可用
Important note - this feature is not available on Visual Studio "Web Developer" edition
这篇关于是否有设置可以在捕获异常时向我显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!