فهرست منبع

Added referenced assembly failure detection, and DI failure protection.

BaronGreenback 4 سال پیش
والد
کامیت
149c2b2169
2فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 2 0
      Emby.Server.Implementations/ApplicationHost.cs
  2. 4 0
      Emby.Server.Implementations/Plugins/PluginManager.cs

+ 2 - 0
Emby.Server.Implementations/ApplicationHost.cs

@@ -413,6 +413,8 @@ namespace Emby.Server.Implementations
             catch (Exception ex)
             {
                 Logger.LogError(ex, "Error creating {Type}", type);
+                // If this is a plugin fail it.
+                _pluginManager.FailPlugin(type.Assembly);
                 return null;
             }
             finally

+ 4 - 0
Emby.Server.Implementations/Plugins/PluginManager.cs

@@ -111,6 +111,10 @@ namespace Emby.Server.Implementations.Plugins
                     try
                     {
                         assembly = Assembly.LoadFrom(file);
+
+                        // This force loads all reference dll's that the plugin uses in the try..catch block.
+                        // Removing this will cause JF to bomb out if referenced dll's cause issues.
+                        assembly.GetExportedTypes();
                     }
                     catch (FileLoadException ex)
                     {