From 2003f50e835aa0e3062660a5da5763cdbc6ddf4a Mon Sep 17 00:00:00 2001 From: Oleg Rakhmatulin Date: Tue, 25 Apr 2023 20:09:03 +0200 Subject: [PATCH] Fixed problem that can be easily reproduced in the .NET SDK 7.0 - module can have attributes defined in the module itself. --- src/AssemblyGenerator.Modules.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AssemblyGenerator.Modules.cs b/src/AssemblyGenerator.Modules.cs index 41362e7..3b90175 100644 --- a/src/AssemblyGenerator.Modules.cs +++ b/src/AssemblyGenerator.Modules.cs @@ -19,10 +19,10 @@ public void CreateModules(IEnumerable moduleInfo) var genericParams = new List(); - CreateCustomAttributes(moduleHandle, module.GetCustomAttributesData()); CreateFields(module.GetFields()); CreateTypes(module.GetTypes(), genericParams); CreateMethods(module.GetMethods(AllMethods), genericParams); + CreateCustomAttributes(moduleHandle, module.GetCustomAttributesData()); // Delaying those writes, because generic parameters must be sorted first. foreach (var dw in genericParams.OrderBy(tu => tu.Index))