Skip to main content

Notifications

Power Apps - Power Apps Pro Dev & ISV
Answered

Plugin Version Management in Solution Upgrades

(0) ShareShare
ReportReport
Posted on by 30

Plugins are made possible through the use of an Assemblies, Plugins, and Steps.

When developing plugins for a Solution, these three pieces are registered and seen as components in the Solution's Plug-in assemblies and Plug-in steps sections.

After exporting this kind of Solution containing plugins, tables, apps, and more, the Solution can be imported with no problems to other environments and, if a previous version of the Solution is already in the environment, changes such as adding Plugins and Steps to the Assembly carry over with Upgrades. Yet, a problem seems to occur when a Plugin is removed.

 

If a Plugin is deleted and unregistered from an Assembly along with its Step(s), everything within the Solution seems to be fine. The Assembly can be updated, Plugins are functional, and the Solution can be exported, then imported to other environments but not if a previous version of the Solution containing that Assembly before Plugin removal is in that environment:

 

Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]

Message: Plugin Assemblies import: FAILURE. Error: Plugin: <NAME OF PLUGIN ASSEMBLY>, Version=<0.1.0.0> ... caused an exception.: Existing plug-in types have been removed. Please update major or minor verion of plug-in assembly. ...

 

Besides the apparent typos in this error message provided by the system, it gives clear direction to update the Plugin Assembly version.

 

Best practice tends to be to open the Assembly's Plugin Library in Visual Studio, open Properties, and in the Application tab, open Assembly Information:

nandrews_1-1695847270772.png

Here you can see the Assembly version and File version were changed from 0.1.0.0 to 0.2.0.0 to represent a minor version change.

Major (X.0.0.0) or Minor (0.X.0.0) changes require the Assembly to be completely reregistered into the environment and Solution it is developed in. After doing so, the old Plugin Assembly along with all its Plugins and Steps can be deleted and unregistered as the new Assembly contains them all and is up to date.

After doing so, the Solution can now be imported and imported as a Solution Upgrade. Yet, there is another problem we encountered when upgrading:

Even though the old, deleted, and unregistered Assembly details are not within the Solution Upgrade, they remain in the upgraded Solution alongside the new Assembly after it is complete as a duplicate...

 

Why is it not removed automatically? Is there a way to have it removed automatically when upgrading? Is there a different method to Assembly versioning that is best practice? Any input or insight is appreciated.

  • Verified answer
    cchannon Profile Picture
    cchannon 4,702 on at
    Re: Plugin Version Management in Solution Upgrades

    Yes. two options:

    • Update the Assembly code directly to remove the plugin and then update the assembly through the Plugin Reg Tool, or
    • Don't unregister the plugin itself, only it's steps.

     

    Either approach will accomplish your goal of removing the plugin functionality, and both will carry through smoothly in a solution.

     

    Before you object--this procedure is because the Assembly contains the code in question, not the plugin. By deleting the Plugin and NOT the assembly, you are breaking a relationship reference, but not actually removing any code. When Dataverse goes to validate your solution it sees changes have been made to the plugins, but that no change has been made to the assembly, which doesn't make any sense. Hence, it stops you. So, either update the Assembly or don't update the Plugin. Steps are expected to get in-UI changes to toggle them on/off so they do not get validated this way, so unregistering the Step and leaving the plugin alone will accomplish the same goal.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard