Server Error in '/' Application.
--------------------------------------------------------------------------------Collection was modified; enumeration operation may not execute.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[InvalidOperationException: Collection was modified; enumeration operation may not execute.]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +48
System.Collections.Generic.Enumerator.MoveNext() +2480553
MMS.Default_Left.CreateMenu() +1212
MMS.Default_Left.Page_Load(Object sender, EventArgs e) +335
System.Web.UI.Control.OnLoad(EventArgs e) +102
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1064
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
--------------------------------------------------------------------------------Collection was modified; enumeration operation may not execute.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:
[InvalidOperationException: Collection was modified; enumeration operation may not execute.]
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +48
System.Collections.Generic.Enumerator.MoveNext() +2480553
MMS.Default_Left.CreateMenu() +1212
MMS.Default_Left.Page_Load(Object sender, EventArgs e) +335
System.Web.UI.Control.OnLoad(EventArgs e) +102
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1064
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50215.44; ASP.NET Version:2.0.50215.44
解决方案 »
- 关于递归返回值的问题!
- 关于在ASP.NET中的 SelectCommand中使用函数的问题
- 将数据集导出成Excel文件,如何弹出一个对话框另存该文件.??
- 那种方法对数据调用效率以及性能处理上比较好?
- 哪有DotNet3.0的SDK下载;跟贴也能给分
- 如何向弹出的新窗口传递SCOPE_IDENTITY()
- .NET 操作各种版本的EXCEL
- 我一直在想,这样的aspx文件编译后放在哪里?
- 采鸟问题请问各位DX
- 窗体身份验证的问题,请指教!
- 如何高效地将一个DATATABLE中指定的记录数复制出来
- 高分回报——一个棘手的问题请教高手:Server Error in '/' Application.
enumerate it.
So, you need synchronization like:lock(tcClientList.SyncRoot)
{
foreach (TcClient tcClient in tcClientList)
...
}
System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +48
System.Collections.Generic.Enumerator.MoveNext() +2480553
MMS.Default_Left.CreateMenu() +1212
MMS.Default_Left.Page_Load(Object sender, EventArgs e) +335
System.Web.UI.Control.OnLoad(EventArgs e) +102
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1064这是什么意思呢? 请各位讲讲…………
{
al.Remove(s);
}?? don't do that, tryfor(int i=al.Count - 1; i>=0; i--)
{
string s = (string)al[i];
al.Remove(s);
}