Jelajahi Sumber

Catch exception for loading an incompatible dll

Bepis 6 tahun lalu
induk
melakukan
1b13b3c78d
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  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;