An item with the same key has already been added

Posted by Community Admin on 04-Aug-2018 06:43

An item with the same key has already been added

All Replies

Posted by Community Admin on 23-May-2013 00:00

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

Posted by Community Admin on 23-May-2013 00:00

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.


Regards,
Nadezhda Petrova
Telerik
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

This thread is closed