knowledgecenter-breadcrum

Knowledge Center

01 Jul, 2024

How to Integrate Third-Party Libraries into Dataverse Plugins

Posted on 01 Jul, 2024 by Mihir Kadam, Posted in C# , Power Platform , Dynamics 365

PluginPackage_Thumbnail Blogs

Introduction 

Integrating third-party libraries into Dataverse plugins used to be difficult and often required unsupported methods like ILMerge. Now, with Plugin Packages, you can easily add any libraries available on NuGet directly into your Dataverse plugins. In this blog, we will see how we can add external library Newtonsoft.Json in Dataverse Plugin, making your plugins more powerful and development easier.

Prerequisites

  • Visual Studio 2022.
  • Access to a Dataverse environment
  • A system user account, with System Administrator or System Customizer role, in the target environment
  • Plug-in Registration tool
  • Microsoft Power Platform CLI
     

Step-by-Step Guide

Step 1:

Create a folder for Plugins

Open Command prompt and navigate to local Path where Plugin folder is present

Step 2:

Run the command pac plugin init --skip-signing. For plug-in packages, we recommend that you use the --skip-signing parameter.

Once Command is executed then it will show a message that Plugin Project is created with Folder Name.

Project will get created in folder.

Step 3:

Open the solution in Visual Studio 2022.

Right click on the Solution and select Existing Project.

Step 4:

Install the Newtonsoft.Json from Nuget package manager.

Package can be visible dependencies.

Step 5:

Below is an example of how to convert JSON to a class using Newtonsoft.Json

Build the Plugin Project  

Step 6:

Open the Plugin Registration Tool "pac tool prt"

Click on Register -> Register New Package

Select the nupkg file from the bin folder.

Note: It might take a few minutes to upload the package.

Change the View to Display by Package

Conclusion 

Dataverse Plugin can now easily integrate third-party libraries from NuGet packages into their plugins, enhancing functionality. This simplifies development and expands the capabilities of Dataverse Plugins.

Comment

Loading

Recent Updates

Thumbnail D365 for Marketing
Blogs
16 Dec, 2024

10 Reasons Why You Need Dynamics 365 for Marketing

This blog discusses the top 10 reasons to choose Dynamics 365 for Marketing to improve your business's marketing efforts.  …

READ MORE
Thumbnail_top 10 benefits of
Blogs
02 Dec, 2024

Top 10 Benefits of Microsoft Dynamics 365

This blog lists the advantages of Microsoft Dynamics 365, focusing on how it can improve your business operations.    …

READ MORE
Thumbnail_Microsoft365 Vs D365
Blogs
12 Nov, 2024

Microsoft 365 vs Dynamics 365

This blog will help you understand the key difference between Microsoft 365 and Dynamics 365, so you can make an…

READ MORE