Sun, 12/26/2021 - 10:40 By Pham Ba Son Contributor Lloyd Sebag
9 comments
Power Platform Tools for Visual Studio

Power Platform Tools for Visual Studio:

CHECK EDIT AT THE END OF THE ARTICLE FOR VISUAL STUDIO 2022 COMPATIBILITY. 

Following the retirement of Microsoft Regional Discovery Service in January 2021, our beloved extension for visual studio, Dynamics 365 Developer Toolkit became obsolete. Being unable to connect to online power platform environment means that we cannot use Dynamics 365 Developer Toolkit to register or deploy assemblies and web resources from visual studio project to online environment. Thankfully, Microsoft has planned for this and release a new extension to fill the void that Dynamics 365 Developer Toolkit left (RIP).

Introducing Power Platform Tools

Using the new service which enable connection from visual studio to power platform environment called Global Discovery Service, Power Platform Tools set out to be a convincing replacement for Dynamics 365 Developer Toolkit with many more utilities features offered to developers than its’ predecessor.

At the time of this article, the latest version of this extension is 1.0.0.0. This version supports connecting to power platform as well as creating, debugging and deploying plugins. Many more features are still in preview including development/deployment of custom workflow activities, web resources, integration technologies like Azure Service endpoints, webhooks, etc.

Create/Develop/Deploy Power Platform plugins

Just like what Dynamics 365 Developer Toolkit has provided us. Power Platform Tools augments Visual Studio with interfaces, features to interact with online environment.

  • Create/Update/Delete plugins.
  • Sign and deploy plugin assemblies.
  • Modify plugin steps and images.
  • Choose which component to deploy.

New plugin created by Power Platform Tools is different from Dynamics 365 Developer Toolkit. This is because the class PluginBase, which your custom plugin classes inherit from, is different between the 2 extension. Because of this, certain features of Power Platform Tools are not available for plugin project generated after Dynamics 365 Developer Toolkit template.

Capability of profiling plugin execution inside Visual Studio.

This feature is a game changer when it comes to plugin development for online environment. Traditionally, debugging a plugin on a dynamics 365 online environment is quite cumbersome. Mostly because of performing this task requires another piece of software. Plugin Registration Tool. I personally hate it having to open another application just to debug my code.

Now, with Power Platform Tools, I can comfortably profile and run debug execution all inside my code editor.

  • Profile plugin execution step
    Power Platform Tools for Visual Studio
  • Debug plugin code with just 2 clicks. With Power Platform Tools, developers no longer need to manually attach the debugger to Plugin Registration process to debug plugin code for power platform environment.
    Power Platform Tools for Visual Studio

All this plugins utilities eliminate the need to use Plugin Registration Tools to interact with the environment.

Generate early bound classes

Yes, you read it right. Power Platform Tools provides us with the ability to generate entity classes from the connected organization inside Visual Studio.

  • This feature allows us to generate entity classes separately or in batch
    Power Platform Tools for Visual Studio

    Power Platform Tools for Visual Studio
  • Pick list for entities to generate
    entity-picklist
  • Parameters for generated file
    Power Platform Tools for Visual Studio

Although this feature should satisfy common use cases of your project. There are some advanced outcomes which help you to better organize your code like field name constants, option set enums, etc. For these you need other method to generate entity class which you can find in this article.

Custom workflow activities

Create or deploying a custom workflow activity remains pretty much the same as Dynamics 365 Developer Toolkit. The workflow project template of Power Platform Tools also has an updated base class. Dynamics 365 Developer Toolkit workflow activity code will need review and updates in order to work with the new template.

Webresources

No supprising here, Power Platform Tools supports deploying javascript, html, css, etc under the package directory.

deploy-webresource

Installing Power Platform Tools

As of now, Power Platform Tools only works with Visual Studio 2019. To install Power Platform Tools onto your Visual Studio 2019, you can either download the .vsix file from the official market page or follow this guide to install it through Visual Studio Extension Manager. CHECK EDIT AT THE END OF THE ARTICLE FOR VISUAL STUDIO 2022. 

Can we migrate/convert projects from Dynamics 365 Developer Toolkit template to Power Platform Tools template?

The team behind Power Platform Tools makes it clear that this extension does not intend to support compatibility with Dynamics 365 Developer Toolkit. This information is in the overview of this extension on visual studio market place.

Of course we always can create a new power platform solution then manually move the code. During this process of moving your code to the new solution, you will have to update a good portion of your code because of the different between the base class of each template. The detail of these changes deserve an article of its' own. After the move, you should delete the old plugin assemblies from your power platform environment then deploy the newly updated one.

For example, the new PluginBase class 

Power Platform Tools for Visual Studio

vs the old PluginBase class

plugin-base-old

The main different of the new plugin base vs the old one is that how the services are served. The class LocalPluginContext has been refined. Property names of this class now precisely tell us what they are for. With this, we have to update our code to the new standard.

Some final words

Power Platform Tools is fairly new and changes are still coming. The information in this article could be outdated at the time you are reading this. I will try my best to update this article if any major changes of Power Platform Tools come out.

If I am wrong, please correct me in the comment. Your opinions are much appriciated.

EDIT 03.01.2023 : If you want to use it for Visual Studio 2022, Microsoft released a new tool very similar to this one but that can support VS 2022. You can find it here

Power Platform Tools for Visual Studio

Comments

Is the Power Platform Tools supports to get/pull the CRM Solutions into VS2019.
Are we planning to have that feature in Power Platform Tools? In Dynamics 365 Developer Toolkit we can easily pull the CRM Solution changes in VS 2019.

Wed, 12/15/2021 - 17:38
Ganesh Shinde (not verified)

Hi,

I can't install .net framework 4.62 since I have latest framework installed in my machine so I can't use power platform tool with VS 2019.

Any idea what is the best tool I can use to develop plugin and deploy from VS Code or VS2019 or VS2022.

Sat, 05/21/2022 - 00:26
Dhavalkumar Ma… (not verified)

Hey great article!

I am getting the error below when trying to generate a strongly-type class from the Power Platform Explorer. Any idea on where I can set the path to the SDK tool? Or where I can install CrmSvcUtil so that the extension will find it?

CrmSvcUtil Failed
---------------------------
Class generation failed to complete. Please check your paths to the SDK tools in the Developer Toolkit settings.

Thu, 08/04/2022 - 06:31
Bernado (not verified)

Add new comment

Image CAPTCHA
Enter the characters shown in the image.