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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -