问题描述
- Collection?was?modified;?错误的解决方法
-
自编了一个资料管理软件,使用vs2010,vb.net编写,运用到ADO?、Access2010,软件分为主界面和分界面,在使用过程中发现,关闭分界面的时候没有安装vs2010的电脑会弹出下面的错误,但是已安装vs2010的电脑则不会弹出错误,求各位大神知道这错误是怎么引起的。(注:全软件编程没有使用到foreach)
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.ComponentModel.Component.Dispose()
???at?System.Windows.Forms.Control.Dispose(Boolean?disposing)
???at?System.ComponentModel.Component.Dispose()
???at?System.Windows.Forms.Control.Dispose(Boolean?disposing)
???at?System.Windows.Forms.TabControl.Dispose(Boolean?disposing)
???at?System.ComponentModel.Component.Dispose()
???at?System.Windows.Forms.Control.Dispose(Boolean?disposing)
???at?System.ComponentModel.Component.Dispose()
???at?System.Windows.Forms.Control.Dispose(Boolean?disposing)
???at?System.Windows.Forms.TabControl.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?WindowsApplication1.admin_dataveiw.Dispose(Boolean?disposing)
???at?System.ComponentModel.Component.Dispose()
???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)
解决方案
安装下.net 4.0的升级补丁,以及microsoft ace 14.0驱动包看看。另外检查电脑是否感染了360等非法流氓软件。
解决方案二:
.net4.0都全部安装了,每台电脑都安装了一套office2010,但是只有安装了vs2010的电脑不会报错
时间: 2024-10-31 11:57:10