An item with the same key has already been added
Hi everybody,
We're taking an error that's 'An item with the same key has already been added' The error appears take data from any dynamic module. We don't connect any sitefinity library. By the way our db connection string is correct.
Sample code :
public IQueryable<DynamicContent> GetDataItems()
DynamicModuleManager dynamicModuleManager = DynamicModuleManager.GetManager();
Type redBannersType = TypeResolutionService.ResolveType("Telerik.Sitefinity.DynamicTypes.Model.MidRedSubjectBanner.RedBanners");
// Fetch a collection of "live" and "visible" redBanners items.
var myCollection = dynamicModuleManager.GetDataItems(redBannersType)
.Where(i => i.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live && i.Visible == true);
return myCollection;
Using sitefinity 6.0. Can somebody show me how to solve this?
Best regards,
Özkan
Hello Özkan,
I noticed your colleague Serhad Suluoğlu have sent a support ticket about this issue.
This issue is caused when you run upgrade again after the first upgrade failed. To fix this you have to run the attached script. Note that first you have to set moduleNameAttributeName to your dynamic module name in FixDynamicModulesModuleNamesControl.cs.
Hope this helps. If you have any further problems regarding this issue, please don't hesitate to contact us again.