Wednesday, July 02, 2008

I get an exception until I delete my *.suo file

A colleague of mine just found the solution to a particularly hard kind of exception raised in Visual Studio 2008. He merged a branch he had made in SVN into the main dev branch. All of a sudden, the project threw an exception, but only in debug mode.

He figured it out by copying file by file from the working folder of his branch to the working folder of the merged branch. Everything was the same except the *.suo file. Once he copied it, it was fine.

It ended up being an option he had set in the "Break when an exception is" dialog box. You get to this from the Debug/Exceptions menu.

Some time beforehand, he had the check box thrown checked for "Common Language Runtime Exceptions". So in debug mode, he was seeing an exception in the .NET runtime that was handled in a try block. You can F5 through the exception because it is handled. If you are not used to seeing handled exceptions this will throw you off.

The problem here is that anyone searching for this error would have to know the solution before being able to find it. Normally you Google the exception text. That could be anything.

So beware! Use the VS 2008 "Break when an exception is" dialog with caution. And then revert back to the default settings as soon as you are done.

No comments: