一个exception就是程序运行时发生的异常情况. Exceptions经常显示你必须去DEBUG的问题的迹象. 如果exception没有在General, Debugging, Options Dialog Box里面被disable, 那么当一个exception产生时debugger(调试器)就会写一个exception消息到输出窗口. debugger可能会或可能不会发生异常时中断执行。
如果发生了一个non-ASP.NET exception而且没有被handled, debugger always breaks execution.
在any handler被调用之前, 你可以直接让debugger去break execution当an exception被抛出. For more information, see How to: Break When an Exception is Thrown.
如果你在用How to: Step Into Just My Code debug, 你有另外的一个选择. 你可以让debugger去break on any exception that is not handled by a handler in user code ("My Code"). For more information, see How to: Break on User-Unhandled Exceptions
ASP.NET has a top-level exception handler that handles exceptions to show error pages to browser users. That top-level exception handler will stop an unhandled exception from breaking into the debugger unless Just My Code is turned on. Make sure that you enable Just My Code for ASP.NET debugging
Remember, if an exception occurs and is not handled at all, the debugger always breaks. The user-unhandled setting does not change that.
The Visual Studio debugger 分为5种类型的exceptions:
1. C++ exceptions - Exceptions thrown from native code.
2. Common language runtime(CLR) exceptions - Exceptions thrown in managed code.
3. Managed debugging assistants - Errors reported to the debugger that indicate problems in the program being debugged, but are not actual exceptions.
4. Native Run-time checks — Errors reported by the CRT for common programming errors.
5. Win32 Exceptions — Operating system error codes such as Control + C and Access Violation.
第三方的debugging engines 也可以加项目到这个列表. 这是个正常的enumerable 集合, indexable by either group name and by integer index.
大多数异常旨在应对一个异常发生时的处理程序。这使程序恢复的异常情况的机会。Native run-time检查没有处理程序。
In a Visual Basic application, the debugger represents all errors as exceptions, even if you use On Error–style error handlers.
For Visual Basic, and C#, the debugger now features a new Exception Assistant that provides more information when an exception occurs.
The following topics provide information on handling exceptions: