InvalidOperationException - Collection was modified; enumeration operation may not execute.

We have been using wyUpdate for about 5 years now and we are randomly getting the following error report on our error reporting service:

System.Windows.Forms.Control.MarshaledInvoke(caller As System.Windows.Forms.Control, method As System.Delegate, args As System.Object[], synchronous As System.Boolean) System.Windows.Forms.Control.Invoke(method As System.Delegate, args As System.Object[])wyDay.Controls.AutomaticUpdater.auBackend_CloseAppNow(sender As System.Object, e As System.EventArgs)wyDay.Controls.AutomaticUpdaterBackend.updateHelper_ProgressChanged(sender As System.Object, e As wyUpdate.Common.UpdateHelperData) wyDay.Controls.UpdateHelper.ProcessReceivedMessage(data As wyUpdate.Common.UpdateHelperData)wyDay.Controls.UpdateHelper.SafeProcessReceivedMessage(message As System.Byte[]) wyDay.Controls.PipeClient.Read() System.Threading.ThreadHelper.ThreadStart_Context(state As System.Object) System.Threading.ExecutionContext.RunInternal(executionContext As System.Threading.ExecutionContext, callback As System.Threading.ContextCallback, state As System.Object, preserveSyncCtx As System.Boolean) System.Threading.ExecutionContext.Run(executionContext As System.Threading.ExecutionContext, callback As System.Threading.ContextCallback, state As System.Object, preserveSyncCtx As System.Boolean) System.Threading.ExecutionContext.Run(executionContext As System.Threading.ExecutionContext, callback As System.Threading.ContextCallback, state As System.Object) System.Threading.ThreadHelper.ThreadStart()

I believe this happens if some of our users click the "Close process" button that wyUpdate shows, whenever shutdown duration of our app is a bit longer than the usual. Do you plan to release a bugfix update for AutomaticUpdater.dll? If not, do you have any suggestions for us to patch that lib to get rid of this error? (I am really pissed whenever see this on our error reports once in a while)

So your users are killing your app? Yes, you'll get unexpected behavior from any code when you end it prematurely.

No, my users are not killing my app, they are just clicking the "Close Process" button (see http://i.imgur.com/cPqchAg.png image) which is provided by the AutoUpdater.

> Yes, you'll get unexpected behavior from any code when you end it prematurely.

If you provide a function like "Close Process", I believe you should handle these unhandled exceptions gracefully.