Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Managed solution import - Component library issue


I have an unmanaged solution in a DEV environment where for some reason I have deleted the component library for the model-driven app.

After that, I created a brand new component library from scratch, published the solution, exported the solution as managed to import it back into my PROD environment to apply the new upgraded version.


After waiting for 41 mins, I got that the solution had failed with the following error message:


Solution History.png


 Import of app module(s) failed: 'The' app cannot be associated to more than one component library. Already exist component library count Microsoft.Xrm.Sdk.DataCollection`1[Microsoft.Xrm.Sdk.Entity]. In Solution Import, please remove library either from Source or Target and try again. I have already removed the old component library from my source environment, so we cannot have two component libraries for one model-driven app


I have already removed the old component library from my source environment, as we cannot have two component libraries for one model-driven app.

The solution is managed and I don't want to delete it in PROD because I have live data.


What will be the solution to this problem to force remove the component library from the production, and re-import the one exported from the DEV environment?

Do we have to investigate in the customizations.xml of the solution or a Web API that deletes the component library or a tool on xrmtoolbox that removes that from the prod environment?

Any help is greatly appreciated.

Thank you

Regular Visitor

Hi @Julien2 , I am facing a similar issue with component library. Did you find any solution? 


Any help on this is much appreciated. Thank you

Hello @KruthiHegde ,

The following steps might help you to delete the component library from the Model Driven App element table:

  1. https://YOURORGURL/api/data/v9.1/appelements?$select=name,appelementid
  2. When you execute the above URL, put the following code in your console:
    var clientUrl = Xrm.Page.context.getClientUrl();
    var req = new XMLHttpRequest()"DELETE", encodeURI(clientUrl + "/api/data/v9.0/appelements(<id>)"), true);
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    var body = JSON.stringify({

Pass the ID of the component library in the parameter above.

  1. 3. Publish the customization.
    4. Delete the component library from the envrionment.
    5. Publish again.
    6. Try to import the solution again to your target instance.

In my case, I deleted it from the sandbox and it worked very well, however, when I try to upgrade the solution, it keeps failing to replace the old one with the new component library.

I hope the above is helpful for you.


Best regards,


Regular Visitor

@Julien2  Thanks for the reply.  I am getting the below undefined response when I execute the above code 


Is there anything that I am missing? 

Also how did you fix the problem with deployment, I may soon run into the same issue with deployment. 


Thank you.

Hello @KruthiHegde ,

I still did not resolve the issue yet I am still finding a way to remove the component from the managed solution.

No, you're not missing anything If you run again the first step which is the web API after publishing you should notice the ID that you passed in the parameter does not exist anymore.


I will keep you posted If I found the solution.


Best regards,


Regular Visitor

@Julien2  That worked for me, Thanks a lot. Now with the deployment to UAT, I have the same issue as you. I was thinking if I can run the same code in target environment and delete the app element record and try importing the solution

Hello @KruthiHegde ,

It also worked for me with the way and steps I provided so it should also work for you in the UAT environment if you follow the same steps.

Please accept my post as a solution if it helped you.

Best regards,

Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (4,371)