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?

Re: Exception handling behaves differently in debug and release versio by ThunderMusic

ThunderMusic
Mon Nov 20 10:04:48 CST 2006

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

"RFlaugher" <RFlaugher@discussions.microsoft.com> wrote in message
news:BC0F4564-7618-4DB7-95DC-F200EABE224D@microsoft.com...
>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?



Re: Exception handling behaves differently in debug and release versio by Michael

Michael
Mon Nov 20 10:59:40 CST 2006

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



Re: Exception handling behaves differently in debug and release versio by Mike

Mike
Tue Nov 21 12:21:53 CST 2006

In article <BC0F4564-7618-4DB7-95DC-F200EABE224D@microsoft.com>, RFlaugher
wrote:
> 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