So I've recently started diving into ClickOnce, and it all seemed very easy and straightforward until I tried to do an in-application update and restart. After the update, whenever I would call Application.Restart(), I got this exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at System.Windows.Forms.Application.ExitInternal()
at System.Windows.Forms.Application.Restart()
It was driving me NUTS - I thought for sure a background thread was misbehaving... nope. The app in question was a multi-form app, always had two windows open. It seems that for whatever reason, Application.ExitInternal() was crapping out on closing the 2nd window before trying to close the main window. SO, I call frmSecondWindow.Close() on the line before Application.Restart(), and everything's peachy.
Every hit I found on Google had questions about this error, but no answers... hope this helps.