From c79e7ac032e83b07fafffab3206c14c9a3294398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 26 Jul 2023 15:54:42 +0900 Subject: [PATCH 1/3] Remove `AssemblyMetadata(".NETFrameworkAssembly", "")` attributes This is likely a .NET Native leftover that is currently (ironically) breaking .NET Native. This attribute indicates to the .NET Native compiler that the assembly can be trimmed. We're currently setting this on assemblies that no longer carry RD.XML to make this safe. Without this attribute, the assembly will be treated like any other and not trimmed. Fixes #44697. --- eng/versioning.targets | 4 ---- .../src/ILLink/ILLink.LinkAttributes.Shared.xml | 7 ------- .../src/Internal/AssemblyAttributes.cs | 1 - 3 files changed, 12 deletions(-) diff --git a/eng/versioning.targets b/eng/versioning.targets index 7746e94594a97..3c3ffa19136ab 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -11,10 +11,6 @@ - - <_Parameter1>.NETFrameworkAssembly - <_Parameter2> - <_Parameter1>Serviceable <_Parameter2>True diff --git a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml index b3f72c0a12502..adbcd6f00ee49 100644 --- a/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml +++ b/src/libraries/System.Private.CoreLib/src/ILLink/ILLink.LinkAttributes.Shared.xml @@ -344,13 +344,6 @@ - - - - .NETFrameworkAssembly - - - diff --git a/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs b/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs index 2d36d0fbbc330..280925881c40d 100644 --- a/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs +++ b/src/libraries/System.Private.CoreLib/src/Internal/AssemblyAttributes.cs @@ -12,7 +12,6 @@ [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32)] [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: NeutralResourcesLanguage("en-US")] From 406f805615871e3ea59d21967b6efa911b37440f Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 26 Jul 2023 06:11:34 -0700 Subject: [PATCH 2/3] Update eng/versioning.targets --- eng/versioning.targets | 2 -- 1 file changed, 2 deletions(-) diff --git a/eng/versioning.targets b/eng/versioning.targets index 3c3ffa19136ab..72678ee199236 100644 --- a/eng/versioning.targets +++ b/eng/versioning.targets @@ -8,8 +8,6 @@ $(AssemblyName) - <_Parameter1>Serviceable From f75e89b0e6d9a6b6a419ef2be1201b5486e71804 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 26 Jul 2023 06:15:17 -0700 Subject: [PATCH 3/3] Delete mention of the attribute in docs --- docs/design/tools/illink/trimmed-assemblies.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/design/tools/illink/trimmed-assemblies.md b/docs/design/tools/illink/trimmed-assemblies.md index 007d24a33129b..bf2b9273d4fc5 100644 --- a/docs/design/tools/illink/trimmed-assemblies.md +++ b/docs/design/tools/illink/trimmed-assemblies.md @@ -182,7 +182,6 @@ If there is a use case for specifying trimmable assemblies on the command-line, We will use `AssemblyMetadataAttribute` to specify `IsTrimmable` on an assembly, instead of introducing a new attribute. The existing attribute seems well-suited for this use case, as it is already similarly used to control servicing for framework assemblies, for example via: ```csharp -[assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyMetadata("PreferInbox", "True")] ```