Skip to content

Distribute your plugins through XrmToolBox and NuGet

Jonas Rapp edited this page Aug 10, 2016 · 11 revisions

Note: This feature is not yet available but planned for April or May release. Please fork XrmToolBox "DEV" branch if you want to test this feature

With latest version of XrmToolBox, you can now discover plugins not distributed by MscrmTools, such as the ones by Jonas Rapp or Daryl LaBar. You can also install them automatically.

This page explains how developer should create NuGet package for their plugins so that they could be discovered by XrmToolBox.

Create a NuGet package

Creating a NuGet package is quite easy and, as I do, you can use NuGet Package Explorer to create your package in a graphical way (or create a bat file). You obviously need to create an account on NuGet so you can obtain an account key to use with NuGet Package Explorer.

Six rules to respect to be sure XrmToolBox can use your package:

  • Fill "Title", "Version", "Authors" and "Description" property in your package to be sure XrmToolBox displays your plugin correctly
  • Fill "Tag" property as XrmToolBox expects it. Tag has to start with "XrmToolBox" but must not be equal to "XrmToolBox" so you need to add more information in the Tag. Good example is "XrmToolBox Plugin Solution transfer"
  • Fill "Version" property with the version of your files in the package. Be careful! all your files should be versionned accordingly to your package. If you keep assembly version to 1.0.0.0, XrmToolBox won't be able to detect that an update is available for your plugin
  • Your package must contain only your files or files that are not already included in XrmToolBox. That means no CRM SDK assembly should be included in your package. But if you are using open source assemblies not already included in XrmToolBox, you should add them as files, not as NuGet package dependencies.
  • All your files must be added under a folder named "Plugins" (see XML sample below)
  • Your package must be dependent to "XrmToolBox" and the version of XrmToolBox your plugin was developed for. This will help XrmToolBox to know if your plugin is compatible with its current version, when a breaking change is introduced.

Publish your package to NuGet

There may be a small delay between when your packaged is published to NuGet, and when they list it on their feed. If it doesn't show up right away, please wait.

Sample NuSpec file

<package>
  <metadata>
    <id>Contoso.Xrm.SweetestPlugin</id>
    <version>1.2016.4.123</version>
    <title>The Sweetest Plugin for XrmToolBox</title>
    <authors>Jane and John Doe</authors>
    <owners>Contoso</owners>
    <projectUrl>https://github.com/Contoso/SweetestPlugin</projectUrl>
    <iconUrl>http://contoso.com/sweetest.ico</iconUrl>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Really sweet plugin that does awesome things</description>
    <summary>Really sweet plugin that does awesome things</summary>
    <releaseNotes>
       With this your life will be a whole lot sweeter.

       1.2016.4.123: New life-enhancer functionality.
       1.2016.3.112: New fantastic button.
    </releaseNotes>
    <copyright>Copyright 2016 Contoso Enterprises</copyright>
    <tags>XrmToolBox Plugins SweetestPlugin</tags>
    <dependencies>
      <dependency id="XrmToolBox" version="1.2016.3.30" />
    </dependencies>
  </metadata>
  <files>
    <file src="SweetestPlugin\bin\Release\Contoso.*.dll" target="lib\net452\Plugins" />
    <file src="SweetestPlugin\bin\Release\ExtraFiles\AnotherFile.dll" target="lib\net452\Plugins\Extra" />
    <file src="SweetestPlugin\bin\Release\ExtraFiles\VeryImportantFile.txt" target="lib\net452\Plugins\Extra" />
  </files>
</package>

Enjoy

XrmToolBox is now able to detect your plugin