What is the best way to catch Exceptions occured in BackgroundWorker in main application thread. I have intensive UPD operations being processed in BackgroundWorker, but when exception occurs, my main application can not log what happened. Please recommend the best practices.
Thanks
You should handle the
RunWorkerCompletedevent, which will be fired on your main application thread.RunWorkerCompletedEventArgs.Errorwill contain the exception, or will be null if there was no exception.