【发布时间】:2013-09-02 05:46:01
【问题描述】:
我有一个可以在 Windows 7 上运行的 C# 应用程序,但不能在 Windows XP 上运行。当我尝试关闭程序窗口时程序崩溃。窗口关闭时没有任何额外的功能,父窗口也不等待任何结果。
这是一个例外:
System.InvalidOperationException:集合已修改;枚举操作可能无法执行。
在 System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource 资源)
在 System.Collections.Generic.List1.Enumerator.MoveNextRare()1.Enumerator.MoveNext()
at System.Collections.Generic.List
在 Microsoft.VisualBasic.PowerPacks.ShapeCollection.Dispose(布尔处理)
在 Microsoft.VisualBasic.PowerPacks.ShapeContainer.Dispose(布尔处理)
在 System.ComponentModel.Component.Dispose()
在 System.Windows.Forms.Control.Dispose(布尔处理)
在 System.Windows.Forms.Form.Dispose(布尔处理)
在 c:\Users\PC_Jeff_1\Desktop\sensors_file1\DataManagerv3.1\EmailSettingsForm.Designer.cs:第 24 行中的 DataManager.EmailSettingsForm.Dispose(Boolean disposing)
在 System.Windows.Forms.Form.WmClose(Message&m)
在 System.Windows.Forms.Form.WndProc(Message&m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
【问题讨论】:
-
您能重新格式化那堵随机文字墙吗?
-
请将
Dispose(bool disposing)方法中的代码包含在c:\Users\PC_Jeff_1\Desktop\sensors_file1\DataManagerv3.1\EmailSettingsForm.Designer.cs中 -
protected override void Dispose(bool disposing) { if (disposing) { if (components != null) { components.Dispose(); } } base.Dispose(disposing); }
标签: c# windows-7 windows-xp