Skip to main content

Add a runtime plugin manually

Abstract

How to install a plugin including how to create an environment folder and a plugin folder, and how to unpack the plugin data from a Nuget package.

Plugins are distributed as Nuget packages. To add a plugin to a host application so that it is loaded at runtime, the plugin must be unpacked and have its assets copied to the correct locations.

The examples below show you how to install a plugin called MyPlugin:

If you do not have one already, you need to create an environment folder under the sitecoreruntime folder. A Sitecore Host application will default its environment to Production. Unless a different environment is supplied at startup (via the --env command) it will look for the production folder first:

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/

For example:  hostapp/sitecoreruntime/production

You can create any number of environment folders that contain different collections of plugins but only one environment can be loaded at a time by a Sitecore Host application.

You need to create a folder for the plugin. This is where the plugin manifest, assets and configuration are located. This is located inside the sitecore folder, which is inside an individual environment folder.

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/
        └── sitecore/
            └── MyPlugin/
       ├── sitecore.plugin.manifest
                ├── content/
                └── config/  

The sitecoreruntime/<env>/sitecore folder does not override files in the hosts sitecore folder. This is a unique folder used for loading plugin assets.

Runtime environment folders cannot contain a sitecoreruntime folder of their own.

Assuming you have a Nuget plugin package called MyPlugin.1.0.0.nupkg:

  1. Download and unpack the plugin contents.

    Note

    A Sitecore Host plugin contains a special sitecore directory in the root of the nupkg package with additional things inside it. Everything else is the standard Nuget structure.

  2. Copy the contents of the Nuget sitecore folder to the plugin folder you created previously (for example,  sitecoreruntime/production/sitecore/myplugin).

  3. If the plugin package contains a lib folder, copy the assets from the correct target framework to the root of the sitecoreruntime/<env> folder (for example, sitecoreruntime/production/*.dll).

  4. Add any additional assemblies that may be required by the plugin from other packages it depends on from Nuget in the same way.

The final structure should be similar to this:

SitecoreHostApp
└── sitecoreruntime/
    └── <env>/
        ├── *.dll
        └── sitecore/
            └── MyPlugin/
                ├── sitecore.plugin.manifest
                ├── content/
                └── config/