Break On All Errors

Posted by AgileCoder on September 3, 2010

Like a lot of .Net developers, I actually got into professional programming on the VB/VBA track.  I worked in Access and VB6 and took the grief from C++ developers, Java developers, FoxPro developers... you get the idea. 

As I transitioned to .Net I have found myself frequently switching between C# and VB.Net.  I love C# syntax, and I love the improvements in each version of Visual Sutdio, but there was one feature I really missed.  I don't know if it was the default in VB6, but you could set the IDE to break on all errors, even if they were handled. I never took the time to figure out if you could do that in VS 2005 or earlier, but I spent some time reviewing code of some of the developers that work for me this week, and I kept seeing a few weird bugs.  I set breakpoints and noticed that there were exceptions thrown, but they were swallowed in the Catch{} statement.

This lead to the discovery of the following VS 2008 Setting:
(Edit - this still works in VS 2010, 2012 and 2013)

Debug > Exceptions (Ctrl D, E) >  Common Language Runtime Exceptions: check the "Thrown" box.

The behavior of the IDE seems identical to the old Break on All Errors from VB6.  In my case, it helped me track down errors in three different classes today.