Add a runtime plugin manually
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
:
Create an environment folder
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.
Create a plugin folder
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.
Unpack plugin data from a Nuget package
Assuming you have a Nuget plugin package called MyPlugin.1.0.0.nupkg
:
-
Download and unpack the plugin contents.
NoteA Sitecore Host plugin contains a special
sitecore
directory in the root of thenupkg
package with additional things inside it. Everything else is the standard Nuget structure. -
Copy the contents of the Nuget
sitecore
folder to the plugin folder you created previously (for example,sitecoreruntime/production/sitecore/myplugin
). -
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
). -
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/