From d4bebbceefb01b02997c4e09e118f42d83eb71d6 Mon Sep 17 00:00:00 2001 From: kasperk81 <83082615+kasperk81@users.noreply.github.com> Date: Sun, 14 Apr 2024 18:58:33 +0300 Subject: [PATCH] fix isnativeaot definition --- src/BenchmarkDotNet/Portability/RuntimeInformation.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BenchmarkDotNet/Portability/RuntimeInformation.cs b/src/BenchmarkDotNet/Portability/RuntimeInformation.cs index 6064b24dfa..a7da3808c6 100644 --- a/src/BenchmarkDotNet/Portability/RuntimeInformation.cs +++ b/src/BenchmarkDotNet/Portability/RuntimeInformation.cs @@ -50,7 +50,7 @@ public static bool IsNetCore public static bool IsNativeAOT => Environment.Version.Major >= 5 - && string.IsNullOrEmpty(typeof(object).Assembly.Location) // it's merged to a single .exe and .Location returns null + && !RuntimeFeature.IsDynamicCodeSupported // is false on NativeAOT && !IsWasm; // Wasm also returns "" for assembly locations #if NET6_0_OR_GREATER