Skip to content

Commit 0cee169

Browse files
authored
Disambiguate NativeAOT, and Wasm identification in BenchmarkDotNet.Portability.RuntimeInformation (#2112)
Fixes #2099 .
1 parent b525ba3 commit 0cee169

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/BenchmarkDotNet/Portability/RuntimeInformation.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ public static bool IsNetCore
4343

4444
public static bool IsNativeAOT
4545
=> Environment.Version.Major >= 5
46-
&& string.IsNullOrEmpty(typeof(object).Assembly.Location); // it's merged to a single .exe and .Location returns null
46+
&& string.IsNullOrEmpty(typeof(object).Assembly.Location) // it's merged to a single .exe and .Location returns null
47+
&& !IsWasm; // Wasm also returns "" for assembly locations
4748

4849
public static bool IsWasm => IsOSPlatform(OSPlatform.Create("BROWSER"));
4950

0 commit comments

Comments
 (0)