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
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.
- You create a workflow on Account and add Create Contact step to the workflow.
- Then you package the workflow with a managed solution and import it to a target system.
- You create a custom option set attribute to the contact entity.
- Then you package it with another solution and install it on to the same target system as the first solution.
- On the target system, open up the workflow editor and select Set Properties button of the Create Contact step.
- Save and close both the step editor and workflow editor without changing anything.
- 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.
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.
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.
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.
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.