Directory.Build.props: don't include commit ID in version#1870
Merged
mjcheetham merged 1 commit intomicrosoft:masterfrom Sep 18, 2025
Merged
Directory.Build.props: don't include commit ID in version#1870mjcheetham merged 1 commit intomicrosoft:masterfrom
mjcheetham merged 1 commit intomicrosoft:masterfrom
Conversation
Since .NET SDK 8, the Informational Version attribute includes the commit ID of the current HEAD at build time. The product code relies on this value to be System.Version-compliant, so we should opt out of this new behaviour. https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
dscho
approved these changes
Sep 18, 2025
Member
dscho
left a comment
There was a problem hiding this comment.
Thank you! This should fix the report where gvfs version includes the commit SHA (and the version checks during gvfs clone fail, as a consequence).
dscho
added a commit
that referenced
this pull request
Sep 18, 2025
…when-revision-is-included Fix `gvfs clone` version check when revision is included in the version string As reported by Tyrie Vella, `gvfs clone` would fail with https://github.com/microsoft/VFSForGit/releases/tag/v1.0.25260.1 when the repository to clone specifies a minimal VFSforGit version in its `gvfs/config` endpoint. The reason is that with the version bump from .NET SDK v3 to v9, the version string included in the assembly now contains the suffix `+<commit-SHA>`, which cannot be parsed by `System.Version`: ``` Cannot clone @ C:\path: System.FormatException: Input string was not in a correct format. at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument) at System.Version.TryParseComponent(String component, String componentName, VersionResult& result, Int32& parsedComponent) at System.Version.TryParseVersion(String version, VersionResult& result) at System.Version.Parse(String input) at System.Version..ctor(String version) at GVFS.CommandLine.GVFSVerb.TryValidateGVFSVersion(GVFSEnlistment enlistment, ITracer tracer, ServerGVFSConfig config, String& errorMessage, Boolean& errorIsFatal) at GVFS.CommandLine.GVFSVerb.ValidateClientVersions(ITracer tracer, GVFSEnlistment enlistment, ServerGVFSConfig gvfsConfig, Boolean showWarnings) at GVFS.CommandLine.CloneVerb.Execute() ``` Matthew Cheetham provided a quick work-around in #1870 to opt out of the new behavior and report the version _without_ that suffix again; Here is a PR that prepares the code to handle such versions gracefully, to open up the door to opt back in to the new behavior (and let `gvfs version` report an even more informative output than right now).
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since .NET SDK 8, the Informational Version attribute includes the commit ID of the current HEAD at build time. The product code relies on this value to be System.Version-compliant, so we should opt out of this new behaviour.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/8.0/source-link