Use one AssemblyLoadContext per plugin

This commit is contained in:
Patrick Barron 2023-01-17 18:49:00 -05:00
parent 875359d457
commit 79a7815be7

View File

@ -123,14 +123,14 @@ namespace Emby.Server.Implementations.Plugins
continue;
}
var assemblyLoadContext = new PluginLoadContext(plugin.Path);
_assemblyLoadContexts.Add(assemblyLoadContext);
foreach (var file in plugin.DllFiles)
{
Assembly assembly;
try
{
var assemblyLoadContext = new PluginLoadContext(file);
_assemblyLoadContexts.Add(assemblyLoadContext);
assembly = assemblyLoadContext.LoadFromAssemblyPath(file);
// Load all required types to verify that the plugin will load