与Windows XP
应用例外,我有一个C#应用程序,它可以在Windows 7,但在Windows XP不起作用。当我尝试关闭程序窗口时程序崩溃。该窗口在关闭时没有任何额外的功能,并且父窗口没有等待任何结果。与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(布尔处置)
微软.VisualBasic.PowerPacks.ShapeContainer.Dispose(布尔处置)
在System.ComponentModel.Component.Dispose()
在System.Windows.Forms.Control.Dispose(布尔处置)
在System.Windows.Forms.Form中.Dispose(布尔处理)
at DataManager.EmailSetting sForm.Dispose(布尔处置)在C:\ Users \用户PC_Jeff_1 \桌面\ sensors_file1 \ DataManagerv3.1 \ EmailSettingsForm.Designer.cs:管线24
在System.Windows.Forms.Form.WmClose(消息&米)
在System.Windows.Forms.Form.WndProc(消息&米)
在System.Windows.Forms.Control.ControlNativeWindow.OnMessage(消息&米)
在System.Windows.Forms.Control.ControlNativeWindow.WndProc(消息(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)
我已经添加try块中部署和a'm没有这个问题了,而是我想问题还是在这里。
块:
protected override void Dispose(bool disposing)`
{
try
{
if (disposing)
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
catch
{
}
}
能否请您重新随机文本的那面墙? – chrylis
请在'c:\ Users \ PC_Jeff_1 \ Desktop \ sensors_file1 \ DataManagerv3.1 \ EmailSettingsForm.Designer.cs'中的'Dispose(bool disposing)'方法中包含代码' –
'protected override void Dispose(bool disposing) { 如果(处置) { 如果(组分!= NULL){ components.Dispose(); } } base.Dispose(处置); }' –