Cannot import managed solution after upgraded from Dynamics CRM 4.0 to CRM 2011
After upgraded from CRM 4.0 to CRM 2011, some users experience the issue when they developed the managed solution from development organization and want to import it to production environment.
When imported, everything seems to be working fine as the progress bar goes until the end. But eventually the import fail and user get error message from Dependency Calculation Item saying a message like:
"Found 9 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = efa9ff93-2e9e-e011-9155-000c293b421c, type = AttributeMap, requiredcomponentobjectid = a12a0085-d57e-413d-9f68-5509c790152c, type= EntityMap, solution = 01759d58-5802-4c43-9ee3-bdd3a5db5b41).”
If they try creating another managed solution containing only a certain Entity, the same behaviour happens and the error message from Dependency Calculation Item becomes:
"Found 6 dependency records where unmanaged component is the parent of a managed component. First record (dependentcomponentobjectid = 37aec869-bdd6-4e9d-aabd-593ad1fe171c, type = Attribute, requiredcomponentobjectid = b11677ff-395c-df11-afc3-000c293b421c, type= Entity, solution = d32dd13c-90e8-4d94-acac-22bf1974161c)."
However, the problem does not occur when importing Unmanaged solution.
This error happens because there is a custom mapping from an entity outside a managed solution to an entity inside a managed solution, which is not allowed.
As user has upgraded the solution from CRM 4.0 to CRM 2011, the entities do already exist and are considered as unmanaged solution outside managed solution. Therefore when import the managed solution, customer get such error message.
Delete the existing AttributeMap from the customation.xml file as well as the CRM system. Then refill the Database by importing the new Managed solution. This can be done by:
1. Back up CRM database, just in case things go wrong.
2. Unzip the solution and modify customization.xml, search for <AttributeMaps> and replace that tag with <AttributeMaps />
Copy all the related attribute mapping definitions (like an example in the red circle) and paste it to notepad, you will need these information later.
Then delete these mapping definitions from the xml file and also delete </AttributeMaps>
Repeat this action for all <AttributeMaps> you find under the EntityMap ( from the example error above there will be 9 places in the file – matches to the error message “Found 9 dependency records where unmanaged component is the parent of a managed component”)
After modification, then zip it back as new solution - Now you have both original solution and new solution as we will need the original one later
3. Remove the corresponding attribute mappings from the DB. By going to your orgName_DB, Search for the records in AttributeMapBase table that has the SourceAttributeName and TargetAttributeName matches to the mapping definitions you have in Notepad. Then delete these records from DB.
4. Import the new solution as managed. Publish all customization
5. Import the original file with the attribute mappings included
Dynamics CRM Team