c# - Determine which thread exception occurred in DispatcherUnhandledException -
i have wpf app in using tasks invoke new threads. have app_dispatcherunhandledexception event in code catch areas occur on thread, works fine. purposes of logging i'd determine whether exception occured on main thread or on task. possible?
the event args object has dispatcher
property, has thread
property:
dispatcher.unhandledexception event - http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.unhandledexception(v=vs.110).aspx
dispatcherunhandledexceptionfiltereventargs class - http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherunhandledexceptionfiltereventargs(v=vs.110).aspx
dispatchereventargs.dispatcher property - http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatchereventargs.dispatcher(v=vs.110).aspx
you can name threads, or store managed id of main 1 identify thread that.
hope helps!
Comments
Post a Comment