I have a background worker object that doesn't seem to be firing its RunWorkerCompleted event. The event handlers are properly wired up during the intialization of the class:
backgroundWorker.WorkerReportsProgress = true;
backgroundWorker.ProgressChanged += OnBackgroundWorkerProgressChanged;
backgroundWorker.RunWorkerCompleted += OnBackgroundWorkerRunWorkerCompleted;
backgroundWorker.DoWork += BackgroundWorkFunction;
In the debugger, I can step through the BackgroundWorkFunction and watch the function correctly execute and return. I have a breakpoint in my OnBackgroundWorkerRunWorkerCompleted event handler, but it never gets hit after the BackgroundWorkFunction returns.
There are some important details to know. I have other tools which work just fine using this same code. What is different about this particular project is that this code is being executed remotely by an IIS web service. The code is executed by a local [TestMethod] in one domain, which calls a web service hosted on a different domain, which then executes this code for me.
I've made simple toy applications which use a web service to create a background worker and it seems to work fine (although I wasn't testing cross domain, just with localhost). I've tried completely rebuilding the project (new solution, new web service) to see if something just got screwed up in Visual C#, but I'm hitting hte same problem still.
I can't find any similar issues searching the internet, so I'm pretty stumped at what could be wrong, or even how to begin debugging :(.
Any help is greatly appreciated. Thanks! :)