Blob Blame History Raw
From 6e57b7c1d7f9b5ce82eef106d465af81382794b3 Mon Sep 17 00:00:00 2001
From: Tom Deseyn <tom.deseyn@gmail.com>
Date: Wed, 15 Dec 2021 15:06:51 +0100
Subject: [PATCH] userlocal detection: also force last digits to zero for
 non-preview versions.

---
 src/Common/WorkloadFileBasedInstall.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Common/WorkloadFileBasedInstall.cs b/src/Common/WorkloadFileBasedInstall.cs
index f0d82c1fa9..0b27b0939c 100644
--- a/src/Common/WorkloadFileBasedInstall.cs
+++ b/src/Common/WorkloadFileBasedInstall.cs
@@ -21,7 +21,7 @@ internal static void SetUserLocal(string dotnetDir, string sdkFeatureBand)
 
         private static string GetUserInstallFilePath(string dotnetDir, string sdkFeatureBand)
         {
-            if (sdkFeatureBand.Contains("-"))
+            if (sdkFeatureBand.Contains("-") || !sdkFeatureBand.EndsWith("00", StringComparison.Ordinal))
             {
                 // The user passed in the sdk version. Derive the feature band version.
                 if (!Version.TryParse(sdkFeatureBand.Split('-')[0], out var sdkVersionParsed))