ERROR: An item with the same key has already been added - General Discussions - General Discussions - Progress Community
 General Discussions

ERROR: An item with the same key has already been added

  • ERROR: An item with the same key has already been added
  • Hey guys,

    So while developing on my Siteinfity Website I keep getting this error. "An item with the same key has already been added." I'm actually running it from VS2010 and not via the Project Manager (4.1.1395.0). Please advise what could be the issue here. 

    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: 

    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: 

    [ArgumentException: An item with the same key has already been added.]
       System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +52
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +9382923
       System.Collections.ObjectModel.KeyedCollection`2.AddKey(TKey key, TItem item) +100
       System.Collections.ObjectModel.KeyedCollection`2.InsertItem(Int32 index, TItem item) +38
       Telerik.Sitefinity.Abstractions.ProvidersCollection`1.InsertItem(Int32 index, TProvider item) +17
       System.Collections.ObjectModel.Collection`1.Add(T item) +98
       Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +252
       Telerik.Sitefinity.Data.ManagerBase`1..ctor(String providerName, String transactionName) +131
       Telerik.Sitefinity.Configuration.ConfigManager..ctor() +13
    
    [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) +98
       System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
       System.Activator.CreateInstance() +103
       Telerik.Sitefinity.Data.ManagerBase`1.GetManager(String providerName, String transactionName) +80
       Telerik.Sitefinity.Configuration.ConfigManager.GetManager() +14
       Telerik.Sitefinity.Security.SecurityManager..cctor() +154
    
    [TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Security.SecurityManager' threw an exception.]
       Telerik.Sitefinity.Security.SecurityManager.UpdateCookies(HttpContextBase context) +0
       Telerik.Sitefinity.Web.SitefinityHttpModule.Context_EndRequest(Object sender, EventArgs e) +19
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    


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

  • Hi Jesster,

    Can you try to upgrade the project to the latest internal build. We noticed this issue in 1395 and upgrading to the latest build seem to fix the problem.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hi,

    I have the same problem. But my issue is My site has many customized modules. When I upgrade I afraid I will lose them.

    and also these error will disappear when I restart IIS.

    Regards,
    Manzoor
  • Hi,

    There shouldn't be an issue with your modules if they are implemented correctly. Since June we have many other important fixes, so it is recommended to use the latest version. You can make a test upgrade on your staging machine.

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Hi Ivan, I'm having the same issue.  Can you tell me what you mean by 'upgrade the project to the latest internal build.'? 

    Thanks,

    Jim