From db3ad16fc093c73f348379eed072545999d93899 Mon Sep 17 00:00:00 2001 From: Richard Webb Date: Tue, 13 Aug 2024 18:19:52 +0100 Subject: [PATCH] Remove Version.Parse check from global.json parsing --- RELEASE_NOTES.md | 1 + src/app/Fake.DotNet.Cli/DotNet.fs | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 06075509a46..469bf8d61b2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -2,6 +2,7 @@ ## 6.1.1 - 2024-08-19 * BUGFIX: Assembly resolver to pick a found SDK instead of first SDK - https://github.com/fsprojects/FAKE/pull/2797/files +* BUGFIX: Fix issue parsing global.json when using prerelease .NET SDKs, thanks @numpsy - https://github.com/fsprojects/FAKE/issues/2803 ## 6.1.0 - 2024-07-27 * BUGFIX: MSBuild.build adds a bad string at the end of properties, thanks @0x53A - https://github.com/fsprojects/FAKE/issues/2738 diff --git a/src/app/Fake.DotNet.Cli/DotNet.fs b/src/app/Fake.DotNet.Cli/DotNet.fs index 4224c5764d7..62e6a2c3eb2 100644 --- a/src/app/Fake.DotNet.Cli/DotNet.fs +++ b/src/app/Fake.DotNet.Cli/DotNet.fs @@ -69,10 +69,7 @@ module DotNet = match sdk.Property("version") with | null -> None - | version -> - let versionValue = version.Value.ToString() - let _ = Version.Parse(versionValue) - Some versionValue + | version -> Some(version.Value.ToString()) with exn -> failwithf "Could not parse `sdk.version` from global.json at '%s': %s" globalJson.FullName exn.Message