소스 검색

Catch TypeLoadException during plugin loading

David Ullmer 4 년 전
부모
커밋
4adbbb9f51
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  1. 6 0
      Emby.Server.Implementations/Plugins/PluginManager.cs

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

@@ -122,6 +122,12 @@ namespace Emby.Server.Implementations.Plugins
                         ChangePluginState(plugin, PluginStatus.Malfunctioned);
                         continue;
                     }
+                    catch (TypeLoadException ex)
+                    {
+                        _logger.LogError(ex, "Failed to load assembly {Path}. Disabling plugin. This is probably caused by an incompatible plugin version.", file);
+                        ChangePluginState(plugin, PluginStatus.Malfunctioned);
+                        continue;
+                    }
 
                     _logger.LogInformation("Loaded assembly {Assembly} from {Path}", assembly.FullName, file);
                     yield return assembly;