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 / Windows Forms / WinForm General / December 2004

Tip: Looking for answers? Try searching our database.

exception not propagating correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christopher Bohn - 15 Dec 2004 20:54 GMT
This refers to KB article #836674
(http://support.microsoft.com/?kbid=836674). I encountered the bug
described in that article, but neither of the workarounds are entirely
satisfactory.

The first workaround, creating the App.config file, only seems to work
when making a debug build.

The second workaround solves the problem, but the process of re-throwing
the exception causes the stack trace contained in the exception to be
reset. The result is that when the exception is finally caught, the
stack trace shows the call stack at the point where the
ThreadExceptionEventHandler re-threw it, instead of where the exception
was originally thrown.

So, is there any way around this? Can I somehow throw the exception
without having its stack trace altered? I don't want to change the code
that eventually catches the exception to deal with this, I would like to
simply get the behavior as it should be if this bug didn't exist at all.
JP.Sklenka - 16 Dec 2004 02:15 GMT
Generally issuing a throw (without specifiying an exception object) maintains
the stack trace to the original exception.  Issuing a throw and specifying an
Exception object, as in throw CaughtException, resets the stack trace at the
point of the re-throw.  

> This refers to KB article #836674
> (http://support.microsoft.com/?kbid=836674). I encountered the bug
[quoted text clipped - 15 lines]
> that eventually catches the exception to deal with this, I would like to
> simply get the behavior as it should be if this bug didn't exist at all.
Christopher Bohn - 21 Dec 2004 15:47 GMT
We already tried the throw with no exception object, it doesn't work:

...\file.cs(77): A throw statement with no arguments is not allowed
outside of a catch clause

So I'm still looking for answers to the original post.  I'm also waiting
for Microsoft to respond to this one since this is filed under my MSDN
account...

> Generally issuing a throw (without specifiying an exception object) maintains
> the stack trace to the original exception.  Issuing a throw and specifying an
[quoted text clipped - 20 lines]
>>that eventually catches the exception to deal with this, I would like to
>>simply get the behavior as it should be if this bug didn't exist at all.
Christopher Bohn - 28 Dec 2004 17:47 GMT
I still haven't seen any reply from Microsoft.  This is using an MSDN
account alias, and I get the required response in other managed news
groups, so I'm not sure why I'm not getting one here.

> We already tried the throw with no exception object, it doesn't work:
>
[quoted text clipped - 30 lines]
>>> like to simply get the behavior as it should be if this bug didn't
>>> exist at all.

Rate this thread:







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.