ghorsington hace 4 años
padre
commit
7c4afe18f8
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      BepInEx.Preloader/Patching/AssemblyPatcher.cs

+ 11 - 1
BepInEx.Preloader/Patching/AssemblyPatcher.cs

@@ -180,7 +180,17 @@ namespace BepInEx.Preloader.Patching
 
 			foreach (string assemblyPath in Directory.GetFiles(directory, "*.dll"))
 			{
-				var assembly = AssemblyDefinition.ReadAssembly(assemblyPath);
+				AssemblyDefinition assembly;
+
+				try
+				{
+					assembly = AssemblyDefinition.ReadAssembly(assemblyPath);
+				}
+				catch (BadImageFormatException)
+				{
+					// Not a managed assembly, skip
+					continue;
+				}
 
 				//NOTE: this is special cased here because the dependency handling for System.dll is a bit wonky
 				//System has an assembly reference to itself, and it also has a reference to Mono.Security causing a circular dependency