Shalster

Hi,

I am having a problem with user-unhandled exceptions in VC# 2005.

I started a project recently and at the beginning of its development, all exceptions that I did not handle caused a break on debug as expected. However at some point this has changed, and now I cannot get the debugger to break at an exception I am not handling. I've tried searching elsewhere for reasons why this might not work but the suggestions made are no help to me. I have "Just My Code" enabled, and in Debug -> Exceptions, all exceptions are ticked such that they should break upon a user-unhandled exception. The only evidence of an exception occurring in the debugger is from "A first chance exception of type <type-here> occurred..."

Would anyone be able to summarise any extra reasons why this feature might not be working

Thanks in advance.



Re: Visual Studio Debugger VC# 2005 Express failing to break on user-unhandled Exception

Andreas Johansson

Can it be that you are building and running the release build rather than the debug version

You should have a toolbar that exposes the build configurations and if it (a combobox) is set to Release you should change it to Debug and when running the application after this change it should break into the debugger on unhandled exceptions.






Re: Visual Studio Debugger VC# 2005 Express failing to break on user-unhandled Exception

Shalster

Hi Andreas,

Thanks for your help.

I have tried to follow this line, but found that my "configuration solutions" drop-down box is always disabled. I found out how to enable this through Tools -> Options etc..., but when enabled it shows me to be in fact running the Debug release, and my application is still failing to break when it should.

Any other ideas Andreas, or anyone else





Re: Visual Studio Debugger VC# 2005 Express failing to break on user-unhandled Exception

nobugz

By default, the debugger won't break on a "first-chance exception". Only on the second chance when there is no catch statement handling the exception. If you want to break on the first chance exception, you'll have to check the "Thrown" checkbox in Debug + Exceptions. Note that this can cause a lot of false breaks as code in the framework throws and catches exceptions.





Re: Visual Studio Debugger VC# 2005 Express failing to break on user-unhandled Exception

Jon Langdon - MSFT

If I understand correctly, you aren't interested in the debugger breaking just because the exception is thrown, but rather if the exception is going to be handled outside of your code, i.e. "user unhandled." Correct

Can you make sure "Break when exceptions cross AppDomain or managed/native boundaries (Managed only)" is checked under Tools|Options|Debugging|General and see if the problem still occurs There are certain use cases where the CLR debugging services won't deliver notifications to the debugger such that they can determine the exception is caught outside of user code.

If you are still having an issue, can you provide code that reproduces the problem so we can investigate

Kind Regards,

Jon