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.