Install Custom PCF Controls in Dynamics 365 9.1 On-Premises

Paul Nieuwelaar, 01 July 2021

Until now, custom PCF controls have only been available for Dynamics 365 Online. If you tried to install a PCF control in a version 9.0 on-premise environment, you would receive an error stating ‘This action is not supported’. With the release of 9.1 for on-premises, and with a little bit of magic, we are now able to install our PCF controls into on-premise environments.

clip_image002

When you package a PCF control into a solution from code, by default the solution XML includes ‘generatedBy="CrmLive"’ which prevents the solution being installed in on-premise environments. Attempting to install this solution into our newly updated 9.1 on-premise environment will give you the error below:

The solution package you are importing was generated on Microsoft Dynamics 365 (online). You can’t import it into on-premises or hosted versions of Microsoft Dynamics 365.

Luckily, we can simply remove this XML attribute from the solution.xml and then repackage the solution and try again. To do this, just unzip the solution, find and edit the solution.xml file, and remove the generatedBy attribute from the first node.

clip_image004

Save the solution.xml, and then zip the solution components again to create the ‘onprem’ version of the solution.

clip_image006

This may also work for other solutions that have been created in an Online environment which contain a PCF control, e.g. our NZ Post Connector which I’ve shown in this blog post. Simply editing the solution.xml as per above allows us to import this into our newly updated 9.1 on-prem environment.

clip_image008

We can now add our custom controls to our forms and make full use of them just like in Dynamics 365 online, and obviously, with the full Unified Interface now as well.

clip_image010