Selaa lähdekoodia

Catch exception for loading an incompatible dll

Bepis 6 vuotta sitten
vanhempi
commit
1b13b3c78d
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  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;