Why I am right!

May 22, 2008

Debugging "caught" Exceptions

Filed under: Debugging, Microsoft, Technology, Visual Studio — Shaun @ 10:05 pm

For the past week or so I noticed a few strange entries in the Visual Studio “Output” window when debugging to a certain page of our app.

Overflow

Something on my page is throwing and catching an OverflowException. Now it probably didn’t matter what was causing this exception because the application was working fine but sometimes things like this bother me enough that I have to figure it out. Luckily there is an easy way to debug ANY exception that you see in that window. I found the solution here.

Once I setup Visual Studio to catch all exceptions of type System.OverflowException (by following the steps in the linked article) the debugger popped the following window anytime that exception was thrown.

  Overflow

From here I was able to follow the stack trace to debug the actual problem which was an Integer getting set incorrectly in a grid we use.

Create a free website or blog at WordPress.com.