I have a class library which throws exceptions on errors. I have an
exception handler several levels above where the exception is thrown to catch
exceptions. When I run the app in the debugger the exception handler is
called, however, when running the app outside of the debugger I get the
unhandled exception dialog and my exception handler is not called. I am
using V2.0 and VS 2005. Does anyone know why this is?
ThunderMusic - 20 Nov 2006 16:04 GMT
Hi,
I had the exact same behavior in one of my tests projects... I never found
why it behaved like this... I'm also looking for an answer...
Can someone help?
ThunderMusic
>I have a class library which throws exceptions on errors. I have an
> exception handler several levels above where the exception is thrown to
[quoted text clipped - 3 lines]
> unhandled exception dialog and my exception handler is not called. I am
> using V2.0 and VS 2005. Does anyone know why this is?
Michael Nemtsev - 20 Nov 2006 16:59 GMT
Hello RFlaugher,
Outside the debugger but the debug version or release?
R> I have a class library which throws exceptions on errors. I have an
R> exception handler several levels above where the exception is thrown
R> to catch exceptions. When I run the app in the debugger the
R> exception handler is called, however, when running the app outside of
R> the debugger I get the unhandled exception dialog and my exception
R> handler is not called. I am using V2.0 and VS 2005. Does anyone
R> know why this is?
R>
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mike Blake-Knox - 21 Nov 2006 18:21 GMT
> When I run the app in the debugger the exception handler is
> called, however, when running the app outside of the debugger I get the
> unhandled exception dialog and my exception handler is not called
Use the Exceptions function in the VS Debug menu to tailor how exceptions
are handled by the debugger. It sounds as if you are set to have the
debugger handle them first (before your exception handler). If you set the
debugger to break on second chance exceptions, VS will let your exception
handler take the exception and only break if the exception isn't handled.
Mike