Remove missing dependencies from solution XML with PowerShell

The import of the solution XYZ failed. The following components are missing in your system and are not included in the solution. Import the managed solutions that contain these components (Active) and then try importing this solution again.

If you ever run into this exception and there are all the components already present in the environment you just need to get rid of few lines in a solution definition in the ZIP file you are trying to import.

Do this only if you are absolutely sure that you know what you are doing.

This is caused by this section of solution.xml file which is inside your solution’s ZIP file.

 

 

The import wizard does not perform any check whether the component is actually present in the environment.

There may be a situation when you have all the components in place and solution import should proceed without issues but the wizard throws this error.

In this case you can delete dependencies from the definition.

If you do it quite often or you need to make it part of your automated deployment, here is a PowerShell script just for that:

 

You can use it like this:

  1. Save the script in a new file. Call it RemoveMissingDependencies.ps1 and place it to the same folder where you’re downloading your solutions.
  2. Open PowerShell in the folder where you downloaded your solution’s ZIP file and where you placed your script.
  3. Invoke this: .\RemoveMissingDependencies.ps1 YourSolution_1_0_0_0_managed.zip
  4. Now you can import the modified file.

 

UPDATE 7/6/2018: The function is included in Dynamics 365 Release Automation Tools

Leave a Reply