From 28dfbe85d1e9d92e93ef2a445ccdf3e7e9a49d2c Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 17 Apr 2026 11:05:03 +0200 Subject: [PATCH] [ios-clr] Tie IsMetadataUpdateSupported to aggressive trimming instead of NativeAOT update (EnC / hot reload) actually relies on reflection metadata preserved by the trimmer. Aggressively-trimmed CoreCLR apps on Apple mobile hit the same limitation. Base the check on ReflectionCacheTests.InvokeClearCache_NoExceptions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Common/tests/TestUtilities/System/PlatformDetection.cs | 2 +- .../System/Reflection/ReflectionCacheTests.cs | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs index 9ddda52552f2d4..7f8fe69f086c35 100644 --- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs +++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs @@ -253,7 +253,7 @@ private static bool GetLinqExpressionsBuiltWithIsInterpretingOnly() public static bool IsInvokingFinalizersSupported => !IsNativeAot; public static bool IsTypeEquivalenceSupported => !IsNativeAot && !IsMonoRuntime && IsWindows; - public static bool IsMetadataUpdateSupported => !IsNativeAot; + public static bool IsMetadataUpdateSupported => !IsBuiltWithAggressiveTrimming; // System.Security.Cryptography.Xml.XmlDsigXsltTransform.GetOutput() relies on XslCompiledTransform which relies // heavily on Reflection.Emit diff --git a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ReflectionCacheTests.cs b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ReflectionCacheTests.cs index d85e041d8a9036..a5922112c1d98e 100644 --- a/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ReflectionCacheTests.cs +++ b/src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Reflection/ReflectionCacheTests.cs @@ -77,7 +77,6 @@ void AssertSameEqualAndHashCodeEqual(object o1, object o2) [ActiveIssue("https://github.com/dotnet/runtime/issues/50978", TestRuntimes.Mono)] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataUpdateSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/124344", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile), nameof(PlatformDetection.IsCoreCLR))] public void InvokeClearCache_NoExceptions() { Action clearCache = GetClearCacheMethod();