exception not propagating correctly

  • Thread starter Thread starter Christopher Bohn
  • Start date Start date
C

Christopher Bohn

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.
 
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.
 
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...
 
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.
 
Back
Top