Browse Source

Catch exception for loading an incompatible dll

Bepis 6 years ago
parent
commit
1b13b3c78d
1 changed files with 5 additions and 1 deletions
  1. 5 1
      BepInEx/TypeLoader.cs

+ 5 - 1
BepInEx/TypeLoader.cs

@@ -40,7 +40,11 @@ namespace BepInEx
                         }
                     }
                 }
-                catch (BadImageFormatException) { }
+                catch (BadImageFormatException) { } //unmanaged DLL
+                catch (ReflectionTypeLoadException)
+                {
+                    BepInLogger.Log($"ERROR! Could not load \"{Path.GetFileName(dll)}\" as a plugin!");
+                } 
             }
 
             return types;