Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Managed solution import - Component library issue

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,

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

  • AkshayKadoo Profile Picture
    6 on at
    Re: Managed solution import - Component library issue
    1. https://YOURORGURL/api/data/v9.1/appelements?$select=name,appelementid

      How to get YOURORGURL?
      I am using : https://make.powerapps.com/
      and in run time I get some fancy url with dynamics.com
      Is this the one?

     

  • EBMRay Profile Picture
    1,710 on at
    Re: Managed solution import - Component library issue

    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,
    Julien

  • Kruthi Profile Picture
    7 on at
    Re: Managed solution import - Component library issue

    @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

  • EBMRay Profile Picture
    1,710 on at
    Re: Managed solution import - Component library issue

    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,

    Julien

  • Kruthi Profile Picture
    7 on at
    Re: Managed solution import - Component library issue

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

    KruthiHegde_0-1664324050896.png

    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.

  • EBMRay Profile Picture
    1,710 on at
    Re: Managed solution import - Component library issue

    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()
      req.open("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({
      });
      req.send(body);​

    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,

    Julien

  • Kruthi Profile Picture
    7 on at
    Re: Managed solution import - Component library issue

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 87 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 71 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 67 Super User 2025 Season 1

Overall leaderboard