I have a C# app which works on Windows 7, but does not work on Windows XP. The program crashes when I try to close a program window. The window doesn't have any extra functions when closing, and the parent window is not waiting for any results.
Here is the exception:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at System.Collections.Generic.List1.Enumerator.MoveNextRare()
1.Enumerator.MoveNext()
at System.Collections.Generic.List
at Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(Boolean disposing)
at Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.Form.Dispose(Boolean disposing)
at DataManager.EmailSettingsForm.Dispose(Boolean disposing) in c:\Users\PC_Jeff_1\Desktop\sensors_file1\DataManagerv3.1\EmailSettingsForm.Designer.cs:line 24
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Dispose(bool disposing)
method inc:\Users\PC_Jeff_1\Desktop\sensors_file1\DataManagerv3.1\EmailSettingsForm.Designer.cs
– Scott Chamberlainprotected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); }
– Виктор Синявский