Exception handling behaves differently in debug and release versio

G

Guest

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?
 
T

ThunderMusic

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
 
M

Michael Nemtsev

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
 
M

Mike Blake-Knox

RFlaugher said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top