From b63b515a274bcffa3d45709dda439dde4b64d79c Mon Sep 17 00:00:00 2001 From: sonyps5201314 Date: Sun, 9 Nov 2025 15:39:27 +0800 Subject: [PATCH] Exclude `System.Runtime.CompilerServices.RefSafetyRulesAttribute` from the `module` attribute in the generated `AssemblyInfo.cs`, because including it causes the compiler error: `error CS8335: Do not use 'System.Runtime.CompilerServices.RefSafetyRulesAttribute'. This is reserved for compiler usage.`. (#3606) --- .../CSharp/Transforms/EscapeInvalidIdentifiers.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs b/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs index 09ea509fd..c56dde2aa 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/EscapeInvalidIdentifiers.cs @@ -136,6 +136,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms switch (trr.Type.FullName) { case "System.Security.UnverifiableCodeAttribute": + case "System.Runtime.CompilerServices.RefSafetyRulesAttribute": attribute.Remove(); break; }