Unfortunately, the problem isn’t caused by any of these, and really exists (even if you don’t get the message) in all of these scenarios.
Your problem is this:
On closing my WinForm App fires of a Form in Dialog mode. That form runs a Background worker that Syncs the DB with the remote DB and displays it’s progress on the “Splash Form.”
Since you’re not actually shutting down when you request a shutdown, all of the “Exit” functions are trying to tear down your background thread. Unfortunately, this is probably happening in the middle of your DB sync, and an enumeration working in the save logic is probably providing that error.
I would recommend not using any of these – just call myMainForm.Close()
instead. That should close your main form, which will fire your closing logic appropriately. Once the main form in your application closes, it will shut down gracefully.