Collection was modified - Issue with 6.1.4 on server
Hi all, we have upgraded a 4.11.10 install to 6.1.4 and everything is running fine locally. When deploying the upgraded application to the staging server (where the current 4.11.10 is running), we can't run the application. The following error is shown:
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.Collections.HashtableEnumerator.MoveNext() +222
Umbraco.Web.UmbracoModule.DisposeHttpContextItems(HttpContext http) +264
Umbraco.Web.UmbracoModule.<Init>b__9(Object sender, EventArgs args) +360
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +163
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +417
So, we tried a clean install of 6.1.4 (manual and webPI) and the problem happens there too. Anyone seen this before? Greatly appreciate any ideas.
Hi Paul, this is vanilla bean. Nothing custom. We put a try/catch around the relevant code (derived from stack trace) in the source, recompiled, and the problem went away. Of course, we'll need to figure out the root cause.
Original code:
private static void DisposeHttpContextItems(HttpContext http)
{
foreach (DictionaryEntry i in http.Items)
{
i.Value.DisposeIfDisposable();
i.Key.DisposeIfDisposable();
}
}
Collection was modified - Issue with 6.1.4 on server
Hi all, we have upgraded a 4.11.10 install to 6.1.4 and everything is running fine locally. When deploying the upgraded application to the staging server (where the current 4.11.10 is running), we can't run the application. The following error is shown:
So, we tried a clean install of 6.1.4 (manual and webPI) and the problem happens there too. Anyone seen this before? Greatly appreciate any ideas.
Thanks!
Nik -
Is this with a vanilla install, or did you deploy with your bits in place already? If so, any chance you can provide relavant custom code?
-Paul
Hi Paul, this is vanilla bean. Nothing custom. We put a try/catch around the relevant code (derived from stack trace) in the source, recompiled, and the problem went away. Of course, we'll need to figure out the root cause.
Original code:
Altered code:
Thanks, Nik
Ah...looks like this from what you sent:
http://stackoverflow.com/questions/604831/collection-was-modified-enumeration-operation-may-not-execute
Care to log an issue? :-)
-Paul
Yeah, found that little gem on Stackoverflow as well. Of course, will log it!
Cheers, Nik
Issue logged here: http://issues.umbraco.org/issue/U4-2738
Thanks!
is working on a reply...