Re: How to force the program to continue after unhandled exception detection



On Sat, 08 Mar 2008 09:45:03 -0800, Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx> wrote:

[...]
The only problem is that I get stucked in VSNET2005 when such an
"unhandled" exception occurs.

I'm not aware of any setting in VS2005 that will allow the debugger to ignore exceptions that would be handled by the .NET GUI thread exception handler. That doesn't mean the setting doesn't exist, it just means I don't know where it is if it does.

I take that back. A few minutes of looking revealed to me that in the Debug/Exceptions... menu, if you uncheck the "User-unhandled" column for an exception, then as long as that exception is handled _somewhere_ (for example, in the Application class's default exception handler, which is active when you subscribe to the ThreadException event), the debugger won't interrupt the program.

I still assert that if your application is dependent on this sort of thing, there's something wrong with the design, and I also don't understand why you aren't able to continue after the exception when it's being handled (that works fine for me). But it appears to me that you can get VS to do exactly what you want, however inappropriate it might be to do so.

Pete
.



Relevant Pages

  • Re: How to force the program to continue after unhandled exception detection
    ... Add this handler for form's Load event: ... Run the application without debugger: ... The debugger detects the unhandled exception and stops the program at ... When I set up a ThreadException handler correctly, by subscribing the handler before I call Application.Run, then once the debugger detects the exception and interrupts the program, I can simply continue execution and the program continues running just as it would have had the debugger not been present. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Implementing Exception Handling in a VM
    ... Why does a debugger require to walk the stack twice? ... Delphi) to only pop up the debugger if the exception isn't caught deeper ... MP> EXCEPTION_REGISTRATION structures until it finds a handler for the ...
    (comp.compilers)
  • Re: How to force the program to continue after unhandled exception detection
    ... Run the application without debugger: ... The debugger detects the unhandled exception and stops the program at ... ThreadException event correctly. ... When I set up a ThreadException handler correctly, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Try Finally...
    ... Now we can protect every more or less specialized action ... an error indication (exception or error code) has to be ... an according exception handler can be inserted into the code. ... resources, as they are related to specific actions. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Strange exception behaviour
    ... I'm left sitting with the debugger pointing to the .ShowDialogcall, ... and showing an exception that obviously happened in some event handler ... As Matt said, this has to do with how .NET is handling calls to the ...
    (microsoft.public.dotnet.framework.windowsforms)