views:

2099

answers:

5

I'm having an odd problem with my vs debugger. When running my program under the vs debugger, the debugger does not break on an unhandled exception. Instead control is returned to VS as if the program exited normally. If I look in the output tab, There is a first-chance exeption listed just before the thread termination.

I understand how to use the "Exceptions" box from the Debug menu. I have the break on unhandled exceptions checked. If I check first-chance exceptions for the specific exeption that is occuring, the debugger will stop.

However, it is my understanding that the debugger should also stop on any 'Unhandled-Exceptions'. It is not doing this for me.

Here are the last few lines of my Output tab:

A first chance exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll
The thread 0x60c has exited with code 0 (0x0).
The program '[3588] ALMSSecurityManager.vshost.exe: Managed' has exited with code -532459699 (0xe0434f4d).

I don't understand why the exception is flagges as a "first chance" exception when it is unhandled.

I believe that the 0xe0434f4d exit code is a generic COM error.

Any Ideas?

Metro.

A: 

There are two checkboxes in the "Exceptions..." box, I usually have to have them both checked to get it to break on unhandled exceptions. Regardless that it only reads like you need to have one checked.

hova
+2  A: 

Ctl-D, E brings up the Exceptions window. You can set what exceptions you want to, and don't want to, break on.

Will
A: 

Once every while this happens to me as well. It seems like a bug or something, as when I replicate the scenario the exception is caught and shown as usual.

Morten Christiansen
+3  A: 

When I read the answer about having two check boxes in the "Exception..." dialog, I went back and opened the dialog again. I only had one column of check boxes -- for break on "Thrown".

As it turns out, if you do not have "Enable Just My Code (Managed Only)" checked in the Debug options, the "User-Unhandled" column does not show in the "Exceptions" dialog.

I selected the "Enable Just My Code" option and verified that the "User-unhandled" checkbox on the "Exceptions" dialog was selected for all of the exception categories.

I was able to get unhandled exceptions to break into the debugger for one session. But when I came back the next day, the behavior was as before.

Metro.

Metro
A: 

Did you ever get a solution to this problem?

I am having the same issue, but only with one of my projects, all others break when they are supposed to. It's driving me nuts trying to fix...

I never did find an answer to this problem. Since then, I have upgraded from Windows/XP to Vista Business. I no longer have the problem. I assume it has more to do with a clean install of VS2008 rather than a different operating system.
Metro