"There was an error calculating dependencies for this component. Missing component id : [GUID]" error occurs when importing a solution into Dynamics 365

Si applica a: Dynamics 365

Symptom


When attempting to import a solution in Dynamics 365, you encounter the following error:

"The import of solution: [solution name] failed"

You may also see a reference to error code 8004F036. If you view the Detail column in the grid, you see a message such as:

"There was an error calculating dependencies for this component. Missing component id [GUID]"

If you click Download Log File and view the Components tab in Excel, you see a message such as:

"The dependent component SystemForm (Id=[GUID 1]) does not exist.  Failure trying to associate it with SystemForm (Id=[GUID 2]) as a dependency. Missing dependency lookup type = PrimaryKeyLookup."

Cause


This error can occur if the solution you are importing includes a component that depends on another component but that dependent component is not in the solution you are importing and does not exist in the target organization. 

Example: You exported a solution from your development environment and tried to import it into your production environment. If the solution contains a component (ex. a system form) that references another dependent component (ex. a view or another system form), this error would occur if that dependent component is not in the solution and not in the target organization.

The error indicates the required dependent component with an id of [GUID 1] does not exist in the solution or the target organization. The solution import process is trying to associate this component to an existing component [GUID 2] as a child dependency. Because component [GUID 1] does not exist, the association cannot be made.

 

Resolution


Use one of the following options to correct this issue:

  1. Add the missing component to the target organization: Add the missing component to the target organization with a solution import. 
  2. Add the missing component to the solution: If the component is in the source organization, then ensure the solution includes this component when it is created.
  3. Remove the dependency to the component: If the missing component is not required in the target organization, then remove the component in the source and recreate the solution.

If you are not sure which component is missing, follow these steps:

1. Unzip the solution .zip file.

2. Open the solution.xml file.

3. Copy the GUID 1 value from the error details and search for that value within the solution.xml file. You may find a section in the XML like the following:

<MissingDependency>

<Required key="591" type="60" displayName="[Component Name 1]" parentDisplayName="[Parent Entity]" solution="[Solution Name]" id="[GUID 1]" />

<Dependent key="34" type="60" displayName="[Component Name 2]" parentDisplayName="[Child Entity]" id="[GUID 2]" />

</MissingDependency>

The XML shown above indicates the solution is missing a dependent component named [Component Name 1] with an id of [GUID 1]. Because this component does not exist within this solution, it needs to exist in the target organization to be imported successfully.

Example Resolution


Example error:

"The dependent component SystemForm (Id=2e28cc31-d344-412d-b393-3e108b23363a) does not exist. Failure trying to associate it with SystemForm (Id=6d2cf5e0-c3bd-40fb-9842-b5c67409e23b) as a dependency. Missing dependency lookup type = PrimaryKeyLookup."

Open the solution.xml file and search for 2e28cc31-d344-412d-b393-3e108b23363a. You will then find the following XML:

<MissingDependency>

<Required key="4" type="60" displayName="Example Dependency" parentDisplayName="Parent" solution="Active" id="{2e28cc31-d344-412d-b393-3e108b23363a}" />

<Dependent key="5" type="60" displayName="Information" parentDisplayName="Child" id="{6d2cf5e0-c3bd-40fb-9842-b5c67409e23b}" />

</MissingDependency>

In the example above, the solution is missing the quick view form named "Example Dependency" which is a component of the entity named "Parent". The entity named "Child" includes a form named "Information". The "Information" form has a dependency on the "Example Dependency" quick view form. Therefore the following resolutions are available:

  1. Import another solution to the target organization that has "Example Dependency" quick view form for entity "Parent" before trying to import this solution.
  2. Ensure that the "Example Dependency" quick view form is included in this solution, which may require the inclusion of the "Parent" entity and the required components.
  3. Remove the "Example Dependency" quick view form dependency from the "Information" form of the "Child" entity in the source organization and recreate the solution.