Showing posts with label Solutions. Show all posts
Showing posts with label Solutions. Show all posts

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.

HOW TO: Organize Visual Studio Solution for Microsoft Dynamics CRM Customizations and Add-ons

Today I want to share how I organize Visual Studio Solution for small and medium size Microsoft Dynamics CRM implementation projects. For big projects solutions' structures are different and significantly depend on projects.

Below you can find common structure of a solution:

It doesn't mean that all solutions I did have the same structure. But all solutions have some or all projects from the list. Some solutions have even more projects.

Let me describe each project and folder one by one.

Error during solution import: Your organization does not allow this type of workflow.

Today I faced following error during solution import:

This workflow cannot be created, updated or published because it was created outside the Microsoft Dynamics CRM Web application. Your organization does not allow this type of workflow.


There is simple solution. You should enable XAML workflows as described here: http://msdn.microsoft.com/en-us/library/8da8c71e-84af-441e-b99b-0b59399f10f6#enable_disable

You can also get this error if you import solution from CRM server which has higher rollup installed then on the target server.