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:


Line 134:                        }
Line 135:
Line 136:                        effPartition p = new effPartition(vals, 4);
Line 137:                        string SubMenustr = "";
Line 138:

Source File: c:\eShopKey\ASP.Net\Shops\marketin\www\menu.incx    Line: 136

Stack Trace:


[InvalidOperationException: Collection was modified; enumeration operation may not execute.]
   System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) +59
   System.Collections.Generic.List`1.ForEach(Action`1 action) +163
   eShopKey.IdNumbers.Reset() +181
   eShopKey.Partition.WrapGreedy(UInt16 ssCnt) +57
   eShopKey.Partition.DoPartition(Int32 i, UInt16 ssCnt) +120
   eShopKey.Partition..ctor(IdNumbers nmbs, Result result, Single avr, Byte limMult) +734
   eShopKey.effPartition.Init(IdNumbers numbs, UInt16 ssCnt, Byte limMult) +306
   eShopKey.effPartition..ctor(List`1 vals, UInt16 ssCnt, Byte limMult) +329
   ASP.viewshopproduct_aspx.DrawMenuCategory(Int64 CategoryId, Int64 LangId, Shop myShop) in c:\eShopKey\ASP.Net\Shops\marketin\www\menu.incx:136
   ASP.viewshopproduct_aspx.DrawMenu(Int64 CategoryId, Int64 LangId, Shop myShop) in c:\eShopKey\ASP.Net\Shops\marketin\www\menu.incx:23
   ASP.viewshopproduct_aspx.DrawMenuCache(Int64 CategoryId, Int64 LangId, Shop myShop) in c:\eShopKey\ASP.Net\Shops\marketin\www\cache_ui.incx:704
   ASP.viewshopproduct_aspx.ProcessInlineTag(String tag, Shop myShop) in c:\eShopKey\ASP.Net\Shops\marketin\www\tags.incx:31
   ASP.viewshopproduct_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) in c:\eShopKey\ASP.Net\Shops\marketin\www\ViewShopProduct.aspx:1420
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +117
   System.Web.UI.Page.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +132
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4642


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4465.0