Skip to content

Commit 495855a

Browse files
committed
allow MosCpuDetector to run on .NET 5+
1 parent 93d12c4 commit 495855a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/BenchmarkDotNet/Detectors/Cpu/Windows/MosCpuDetector.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Management;
45
using BenchmarkDotNet.Extensions;
@@ -14,7 +15,8 @@ internal class MosCpuDetector : ICpuDetector
1415
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
1516
#endif
1617
public bool IsApplicable() => OsDetector.IsWindows() &&
17-
RuntimeInformation.IsFullFramework &&
18+
(RuntimeInformation.IsFullFramework ||
19+
(RuntimeInformation.IsNetCore && Environment.Version.Major >= 5)) &&
1820
!RuntimeInformation.IsMono;
1921

2022
#if NET6_0_OR_GREATER

0 commit comments

Comments
 (0)