An item with the same key has already been added. ??

Posted by Community Admin on 03-Aug-2018 21:20

An item with the same key has already been added. ??

All Replies

Posted by Community Admin on 26-Apr-2011 00:00

Hi 
I have created a additional project to try something. 

I wanted to add a language EN-US to the default EN one and I got this error message. 

I deleted this project. 

But the problem I got the same message when trying to open my main project. 

I get always the same error even after putting a back up of my DB project. : 

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.]
   DynamicModule.ns.Wrapped_OpenAccessPageProvider_5694dfcee18149efb42569716a0efa5c.Initialize(String providerName, NameValueCollection config, Type managerType) +405
   Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, Type providerType, ExceptionPolicyName policy, ManagerBase`1 manager) +2211
   Telerik.Sitefinity.Data.ManagerBase`1.InstantiateProvider(IDataProviderSettings providerSettings, ExceptionPolicyName policy, ManagerBase`1 manager) +74
   Telerik.Sitefinity.Data.ManagerBase`1.SetProvider(String providerName, String transactionName) +214
   Telerik.Sitefinity.Modules.Pages.PageManager..ctor() +93
   Telerik.Sitefinity.Modules.Pages.PageManager..cctor() +41

[TypeInitializationException: The type initializer for 'Telerik.Sitefinity.Modules.Pages.PageManager' threw an exception.]
   Telerik.Sitefinity.Modules.Pages.PageManager.GetManager() +0
   Telerik.Sitefinity.Services.SystemManager.Initialize() +1274
   Telerik.Sitefinity.Abstractions.Bootstrapper.RegisterRoutes(RouteCollection routes) +243
   Telerik.Sitefinity.Abstractions.Bootstrapper.Bootstrap() +338
   Telerik.Sitefinity.Web.SitefinityHttpModule.Init(HttpApplication context) +30
   System.Web.HttpApplication.InitModulesCommon() +192
   System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +1504
   System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +348
   System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +200
   System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +286

Any Idea about what could be the problem. 

Thanks

Posted by Community Admin on 27-Apr-2011 00:00


Hi, 
I solved this :  it is in the ResourceConfig 

<add culture="en-US" uiCulture="en" key="english-en-us" />
<add culture="fr-CA" uiCulture="fr-CA" key="french (canada)-fr-ca" />
<add culture="fr" uiCulture="fr" key="french-fr" />
<add culture="en" uiCulture="en" key="english-en" />


I deleted the entry for  culture="en" and it fixed the problem. 

the error is telling that culture="en-US" and culture="en" use the same Key (here they are different:) ) but I don't know where this could come from. 

This thread is closed