Skip to content

Commit 8e355b5

Browse files
authored
fix .NET 4.8.1 detection (#2067)
1 parent 7fb8723 commit 8e355b5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/BenchmarkDotNet/Helpers/FrameworkVersionHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ internal static class FrameworkVersionHelper
1111
// should be ordered by release number
1212
private static readonly (int minReleaseNumber, string version)[] FrameworkVersions =
1313
{
14+
(533320, "4.8.1"), // value taken from Windows 11 arm64 insider build
1415
(528040, "4.8"),
1516
(461808, "4.7.2"),
1617
(461308, "4.7.1"),
@@ -48,7 +49,7 @@ internal static string MapToReleaseVersion(string servicingVersion)
4849
return "4.7.1";
4950
if (string.Compare(servicingVersion, "4.8") < 0)
5051
return "4.7.2";
51-
if (string.Compare(servicingVersion, "4.8.1") < 0)
52+
if (string.Compare(servicingVersion, "4.8.9") < 0)
5253
return "4.8";
5354

5455
return "4.8.1"; // most probably the last major release of Full .NET Framework

tests/BenchmarkDotNet.Tests/FrameworkVersionHelperTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ public class FrameworkVersionHelperTests
1919
[InlineData("4.7.3324.0", "4.7.2")]
2020
[InlineData("4.8", "4.8")]
2121
[InlineData("4.8.024", "4.8")]
22+
[InlineData("4.8.4510.0", "4.8")]
23+
[InlineData("4.8.4526.0", "4.8")]
24+
[InlineData("4.8.9032.0", "4.8.1")]
2225
public void ServicingVersionsAreMappedToCorrespondingReleaseVersions(string servicingVersion, string expectedReleaseVersion)
2326
{
2427
Assert.Equal(expectedReleaseVersion, FrameworkVersionHelper.MapToReleaseVersion(servicingVersion));

0 commit comments

Comments
 (0)