0

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.

Corey
  • 398
  • 1
  • 4
  • 18
  • Using a 64-bit operating system? Platform target set to x86? – Hans Passant Apr 16 '12 at 21:49
  • No to both. Besides, this isn't a published version / compiled exe I'm running, just debugging code within the vs2008 environment. I don't believe I've explicitly changed any project/environment settings. – Corey Apr 17 '12 at 18:16

1 Answers1

1

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

joce
  • 9,624
  • 19
  • 56
  • 74
  • Yup, already checked that. Should be breaking on user-unhandled exceptions. In stead it's taking me straight to the form dispose. Also opened another project, and breaking is still working as expected in the other project, just not this one. – Corey Apr 16 '12 at 20:14
  • Try breaking on exception thrown instead of user-unhandled. – joce Apr 16 '12 at 20:16
  • This works, but I'd like to figure out why there seems to be an additional unhandled exception handler that disposes the forms. – Corey Apr 16 '12 at 20:42