Cannot delete component error when trying to uninstall a solution

This article provides a solution to an error that occurs when you try to uninstall a solution.

Applies to:   Microsoft Dynamics CRM 2011
Original KB number:   2501748

Symptoms

Trying to uninstall a managed solution fails when an option set has a default value and the entity is used in a workflow from a different solution.

For Example:

  1. You create a workflow on Account and add Create Contact step to the workflow.
  2. Then you package the workflow with a managed solution and import it to a target system.
  3. You create a custom option set attribute to the contact entity.
  4. Then you package it with another solution and install it on to the same target system as the first solution.
  5. On the target system, open up the workflow editor and select Set Properties button of the Create Contact step.
  6. Save and close both the step editor and workflow editor without changing anything.
  7. Try to uninstall the second solution that installed the option set attribute.

You'll see the following error message:

Cannot Delete Component
Cannot delete Solution because one ore more components require it.

Note

This issue happens even if you don't modify the workflow and properties at all. The issue is that you updated properties of the workflow by selecting save and close.

Cause

When an entity has an option set field, which has a default value specified, this default value information will be included once you save the workflow. It makes dependency inside the system on the solutions, which causes the uninstall issue for the solution.

Resolution

It's by design. The workaround for this issue is to remove the default value for the option set. After removing the default value, reupdate the Set Properties on the workflow step, then you should uninstall the solution.

Note

If the managed solution is set to not allow customizations to it fields, then the developer of the solution would need to update their unmanaged solution.