Posted by jpluimers on 2013/08/29
When you have a layered exception handling (for instance to translate general exceptions into domain or business exceptions, and want to control which exceptions trickle up to where), then from a debugger perspective, most exceptions actually handled.
However debugging those layers, it often makes sens to be able to break where all these exceptions are actually fired.
The screenshots (click on each to enlarge) are for Visual Studio 2010, but it works in any Visual Studio version and (since it is a debugger feature, not a language one) for all .NET languages I tried so far.
Note that as of Visual Studio 2010, if you disable these, it still breaks when exceptions are thrown from code called through reflection. This seems intentional and has 3 workarounds, but it might have been reverted in Visual Studio 2012.
This is a setting stored on the Solution level (.suo file) in Visual studio which by default is turned off. Luckily, it is very easy to turn this feature on, for instance for CLR (.NET Common Language Runtime) exceptions:
- In the “Debug” menu, choose “Exceptions” (or Press Ctrl+D, E),
- Wait a few moments for the dialog to appear
- Put a checkmark in the “Thrown” column for the “Comon Language Runtime Exceptions” row.
- Click the “OK” button. Read the rest of this entry »
Like this:
Like Loading...
Posted in .NET, .NET 1.x, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 1.0, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Development, F#, Prism, Software Development, VB.NET, VB.NET 10.0, VB.NET 11.0, VB.NET 7.0, VB.NET 7.1, VB.NET 8.0, VB.NET 9.0 | 1 Comment »