CRM 2011. Solution import fails with error "An item with the same key has already been added."

Today I was helping to resolve following error during solution import: "An item with the same key has already been added".

I took traces and found following:

EntityService.Update caught exception: System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Crm.Metadata.OptionSetService.GetExistingAttributePicklistInternal(Guid optionSetId, OptionSetType optionSetType, Nullable`1 optionValue, ISqlExecutionContext context)

Method "GetExistingAttributePicklistInternal" is retrieving picklist values from CRM and adding these values to a dictionary. It means that you have a problem with CRM instance you are deploying solution into.

I didn't have a chance to find a way how to fix this issue. We decided to use another environment for now and successfully deployed our solution.

2 comments

avatar

Very good content. I read your blog that was awesome, please doing continue daily post. Customer Relations Software in Indore

avatar

this is the best softwre you can do this foe small business B2B Lead Generation Software. this software for handle online accounting