Search code examples
c#winformsvisual-studio-2008.net-3.5componentone

Visual Studio 2008 - Unhandled Exception straight to Form Dispose


I'm using Visual Studio 2008, and working on a winform. Usually, on the event of an unhandled exception, the code will break on the line causing the error. However, it has started simply closing the form. When stepping through the code, it will go straight from the unhandled exception to the form dispose, and close my application.

Have I inadvertently changed an option?

For testing purposes, I created an empty windows form, with only one line:

throw new Exception();

And observed the same behavior. Also, everything is set to break when user-unhandled exceptions arise. I've tried another project without the issue, so it must be project specific.


Solution

  • Go to Menu | Debug | Exceptions... and make sure VS breaks on the proper exceptions.