C# Background worker setting e.Result in DoWork and getting value back in WorkCompleted
C# 2008 SP1 I am using the background worker If one of the conditions fails I will set e.cancel to true, and assign the string to the e.result. Everything works there. However, when the workCompleted fires, I test for the e.Result and I get an exception "e.result throw an exception of type systeminvalidoperation". I guess I could use a global variable to set in the DoWork and compare in the work completed. But this might not be threadsafe. Can anyone tell me why I am getting this with the e.Result, and how can I solve this? Many thanks, private void bgwPrepareCall_DoWork(object sender,