Runtime configuration
You can alter from where and how runtime plugins are loaded. The sitecorehost.xml file contains a Plugins/Runtime section like this:
<Sitecore>
<Plugins>
<Runtime>
<Location>sitecoreruntime</Location>
<UseCustomAssemblyLoadContext>false</UseCustomAssemblyLoadContext>
</Runtime>
</Plugins>
</Sitecore>You can set the Location and UseCustomAssemblyLoadContext :
-
LocationSpecifies where the runtime data is located. The value can be either a relative or absolute path to the location. The default value is
sitecoreruntime. -
UseCustomAssemblyLoadContextYou can only use this if the host is targeting
netcoreapp2.0.If set to true, a custom
AssemblyLoadContextis used to load all plugin assemblies. This is useful if you want to to load a different version of a dependency into the process. For example, If the host process has a dependency onNewtonsoft.Jsonversion 10, but a plugin has a dependency on version 11.If set to false, only
Newtonsoft.Jsonassembly version 10 is loaded, for both host and runtime plugins.The default value is: false.
Assembly loading in full .NET Framework applications
If the host process is targeting full framework (for example, net471), the runtime assemblies referenced by the plugins sitecore.plugin.manifest files (along with their dependencies) are located and loaded into the application domain.
All assemblies from the hosts bin directory are loaded into the assembly Load context, while the plugin assemblies are loaded into a separate LoadFrom context.
Assembly loading in NetCore applications (netcoreapp)
If the host process is targeting netcoreapp2.0 (or above), the runtime assemblies referenced by the plugins' sitecore.plugin.manifest files (along with their dependencies) are located and loaded into the default AssemblyLoadContext along with assemblies loaded from the bin directory of the host process.