From 5be3ceeab87acd9d924014d0975030c5bc896b10 Mon Sep 17 00:00:00 2001 From: Hamunii Date: Thu, 6 Nov 2025 01:42:55 +0200 Subject: [PATCH] Update to AsmResolver 6.0.0-beta.4 Fixes issue where AsmResolver fails to read certain assemblies which would break BepInEx.AssemblyPublicizer from publicizing them. https://github.com/Washi1337/AsmResolver/pull/609 adjusted code to build with new AsmResolver 6 API changes --- BepInEx.AssemblyPublicizer/AssemblyPublicizer.cs | 2 +- BepInEx.AssemblyPublicizer/BepInEx.AssemblyPublicizer.csproj | 2 +- BepInEx.AssemblyPublicizer/OriginalAttributesAttribute.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/BepInEx.AssemblyPublicizer/AssemblyPublicizer.cs b/BepInEx.AssemblyPublicizer/AssemblyPublicizer.cs index ef66ad8..424efef 100644 --- a/BepInEx.AssemblyPublicizer/AssemblyPublicizer.cs +++ b/BepInEx.AssemblyPublicizer/AssemblyPublicizer.cs @@ -49,7 +49,7 @@ private static void Publicize(TypeDefinition typeDefinition, OriginalAttributesA if (!methodDefinition.HasMethodBody) continue; - var newBody = methodDefinition.CilMethodBody = new CilMethodBody(methodDefinition); + var newBody = methodDefinition.CilMethodBody = new CilMethodBody(); newBody.Instructions.Add(CilOpCodes.Ldnull); newBody.Instructions.Add(CilOpCodes.Throw); methodDefinition.NoInlining = true; diff --git a/BepInEx.AssemblyPublicizer/BepInEx.AssemblyPublicizer.csproj b/BepInEx.AssemblyPublicizer/BepInEx.AssemblyPublicizer.csproj index 2ebbc4b..2e02437 100644 --- a/BepInEx.AssemblyPublicizer/BepInEx.AssemblyPublicizer.csproj +++ b/BepInEx.AssemblyPublicizer/BepInEx.AssemblyPublicizer.csproj @@ -10,7 +10,7 @@ - + diff --git a/BepInEx.AssemblyPublicizer/OriginalAttributesAttribute.cs b/BepInEx.AssemblyPublicizer/OriginalAttributesAttribute.cs index 9291e2a..37b36b1 100644 --- a/BepInEx.AssemblyPublicizer/OriginalAttributesAttribute.cs +++ b/BepInEx.AssemblyPublicizer/OriginalAttributesAttribute.cs @@ -44,7 +44,7 @@ public OriginalAttributesAttribute(ModuleDefinition module) ); Type.Methods.Add(constructorDefinition); - var body = constructorDefinition.CilMethodBody = new CilMethodBody(constructorDefinition); + var body = constructorDefinition.CilMethodBody = new CilMethodBody(); body.Instructions.Add(CilOpCodes.Ldarg_0); body.Instructions.Add(CilOpCodes.Call, baseConstructorReference); body.Instructions.Add(CilOpCodes.Ret);