diff --git a/src/Foundation/LinkerSafeAttribute.cs b/src/Foundation/LinkerSafeAttribute.cs index af6000b756bd..85f449ed5f8d 100644 --- a/src/Foundation/LinkerSafeAttribute.cs +++ b/src/Foundation/LinkerSafeAttribute.cs @@ -25,8 +25,10 @@ using System; namespace Foundation { - + +#if NET [Obsolete ("Replace with '[assembly: System.Reflection.AssemblyMetadata (\"IsTrimmable\", \"True\")]'.")] +#endif [AttributeUsage (AttributeTargets.Assembly)] public sealed class LinkerSafeAttribute : Attribute { diff --git a/tools/common/Tuning.cs b/tools/common/Tuning.cs index 71c5fce0262e..0d5c0b34a4c1 100644 --- a/tools/common/Tuning.cs +++ b/tools/common/Tuning.cs @@ -127,13 +127,8 @@ protected override bool IsLinkerSafeAttribute (CustomAttribute attribute) case "LinkerSafeAttribute": return true; // namespace is not important case "AssemblyMetadataAttribute": - if (!attribute.HasConstructorArguments) - return false; - if (at.Namespace != "System.Reflection") - return false; - if (attribute.ConstructorArguments [0].Value as string != "IsTrimmable") - return false; - return (attribute.ConstructorArguments [1].Value.ToString ().ToLowerInvariant () == "true"); + // this is only true for net6+ and can depends on other features not available on the legacy linker + return false; } return false; }