Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / November 2006

Tip: Looking for answers? Try searching our database.

Exception handling behaves differently in debug and release versio

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RFlaugher - 20 Nov 2006 15:53 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.