diff --git a/GVFS/GVFS.Common/ProcessHelper.cs b/GVFS/GVFS.Common/ProcessHelper.cs index ad24a6434..4fa57fbaf 100644 --- a/GVFS/GVFS.Common/ProcessHelper.cs +++ b/GVFS/GVFS.Common/ProcessHelper.cs @@ -58,17 +58,7 @@ public static string GetCurrentProcessVersion() public static bool IsDevelopmentVersion() { string version = ProcessHelper.GetCurrentProcessVersion(); - /* When debugging local version with VS, the version will include +{commitId} suffix, - * which is not valid for Version class. */ - var plusIndex = version.IndexOf('+'); - if (plusIndex >= 0) - { - version = version.Substring(0, plusIndex); - } - - Version currentVersion = new Version(version); - - return currentVersion.Major == 0; + return version.Equals("0.2.173.2") || version.StartsWith("0.2.173.2+"); } public static string GetProgramLocation(string programLocaterCommand, string processName) diff --git a/GVFS/GVFS/CommandLine/GVFSVerb.cs b/GVFS/GVFS/CommandLine/GVFSVerb.cs index a9fcb9587..fa183c7a3 100644 --- a/GVFS/GVFS/CommandLine/GVFSVerb.cs +++ b/GVFS/GVFS/CommandLine/GVFSVerb.cs @@ -933,7 +933,11 @@ private bool TryValidateGVFSVersion(GVFSEnlistment enlistment, ITracer tracer, S return true; } - Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion()); + string recordedVersion = ProcessHelper.GetCurrentProcessVersion(); + // Work around the default behavior in .NET SDK 8 where the revision ID + // is appended after a '+' character, which cannot be parsed by `System.Version`. + int plus = recordedVersion.IndexOf('+'); + Version currentVersion = new Version(plus < 0 ? recordedVersion : recordedVersion.Substring(0, plus)); IEnumerable allowedGvfsClientVersions = config != null ? config.AllowedGVFSClientVersions