浏览代码

Use one AssemblyLoadContext per plugin

Patrick Barron 2 年之前
父节点
当前提交
79a7815be7
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Emby.Server.Implementations/Plugins/PluginManager.cs

+ 3 - 3
Emby.Server.Implementations/Plugins/PluginManager.cs

@@ -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