I was working with UI thread / background thread issues
today and ran into a strange problem where the exception
thrown on a background thread doesn't get cought by the
UI thread exception handler (nor does it break into the
debugger, which I actually wanted).
Branch out to the UI thread by using an invoke and
rethrow the exception you would say, well... that
doesn't work also. Seems like when the exception gets
raised on a non-UI-thread and you invoke back to the UI
thread somehow the thread event handler still stays on
the non-UI-thread.
Did you run into anything similiar and if so how did you
solve this?
Thanks!
if you do a try-catch in the other thread and call a
"ui-Safe" method to use the exception
and message, shouldn't that solve your problem?
I can use the exception (for instance MessageBox.Show()
or even Debugger.Break) but it won't give me the full
stack trace, but oh well can't have it all :-)
Waseem: No - you lose the stack trace.... I couldn't
find a way around that either.