diff --git a/GVFS/GVFS.Common/ProcessHelper.cs b/GVFS/GVFS.Common/ProcessHelper.cs index 979f2ff14..ad24a6434 100644 --- a/GVFS/GVFS.Common/ProcessHelper.cs +++ b/GVFS/GVFS.Common/ProcessHelper.cs @@ -57,7 +57,16 @@ public static string GetCurrentProcessVersion() public static bool IsDevelopmentVersion() { - Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion()); + 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; } diff --git a/GVFS/GVFS/CommandLine/GVFSVerb.cs b/GVFS/GVFS/CommandLine/GVFSVerb.cs index 8449b5bab..cdf9e920e 100644 --- a/GVFS/GVFS/CommandLine/GVFSVerb.cs +++ b/GVFS/GVFS/CommandLine/GVFSVerb.cs @@ -926,8 +926,14 @@ private bool TryValidateGVFSVersion(GVFSEnlistment enlistment, ITracer tracer, S using (ITracer activity = tracer.StartActivity("ValidateGVFSVersion", EventLevel.Informational)) { - Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion()); + if (ProcessHelper.IsDevelopmentVersion()) + { + /* Development Version will start with 0 and include a "+{commitID}" suffix + * so it won't ever be valid, but it needs to be able to run so we can test it. */ + return true; + } + Version currentVersion = new Version(ProcessHelper.GetCurrentProcessVersion()); IEnumerable allowedGvfsClientVersions = config != null ? config.AllowedGVFSClientVersions