November Happy Hour will be moved to Thursday December 5th.

7.1 Update successful, but upon reloading site receive 'An item with the same key has already been added'

Vote:
 

I was sucessfully able to install patch 2 through nuget, everything worked, then I installed 7.1 through the addon store, clicking update on the edit ui first and everything updated and asked me to restart the site.  I did, but then received this error message:

 

Server Error in '/' Application.


An item with the same key has already been added.

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.ArgumentException: An item with the same key has already been added.

Source Error: 

[No relevant source lines]


Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\078d431a\ccbd4660\App_global.asax.0.cs    Line: 

Stack Trace: 

[ArgumentException: An item with the same key has already been added.]
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +14169316
   System.Linq.Enumerable.ToDictionary(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +267
   EPiServer.PlugIn.PlugInLocator.get_Assemblies() +760
   EPiServer.PlugIn.PlugInLocator.Search(PlugInAttribute matchAttribute) +75
   EPiServer.DynamicContent.DynamicContentPlugInAttribute.Start() +79

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +229
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +193
   System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2924
   EPiServer.PlugIn.PlugInRuntime.Start(Boolean reset) +556
   EPiServer.Initialization.PlugInInitialization.Initialize(InitializationEngine context) +11
   EPiServer.Framework.Initialization.ModuleNode.Execute(Action a, String key) +64
   EPiServer.Framework.Initialization.InitializationEngine.InitializeModules() +719
   EPiServer.Framework.Initialization.InitializationEngine.Initialize(HostType hostType) +168
   EPiServer.Framework.Initialization.InitializationModule.Initialize(HostType hostType) +285
   EPiServer.Framework.Initialization.InitializationModule.FrameworkInitialization(HostType hostType) +104
   EPiServer.Global..ctor() +110
   ASP.global_asax..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\078d431a\ccbd4660\App_global.asax.0.cs:0

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +159
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +256
   System.Activator.CreateInstance(Type type, Boolean nonPublic) +127
   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +14426381
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +200
   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
   System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +83
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +312
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12880068
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12721257

 


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

#70106
Apr 11, 2013 20:57
Vote:
 

I'm unable to reach any mode in EPi - please help! Not sure what 7.1 changed to cause this error and I'm stuck!

#70107
Apr 11, 2013 21:07
Vote:
 

I've seen that error once before - occured after changing namespace on a page type definition. It got registered as two different types in the database, using the same guid. 

The stack trace indicates that this might be related to dynamic content. Can you double check your code, that you don't have registered two dynamic content classes with the same guid?

#70119
Apr 12, 2013 9:12
Vote:
 

Make sure you don't have any extra .dlls in your /bin folder. For some reason we had a copy of EPiServer.Cms.Shell.UI.dll in the folder and after the 7.1 update PlugInLocator was trying to load both the old and updated versions of the dll, which caused the "An item with the same key has already been added." error.

#70130
Apr 12, 2013 11:01
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.