Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE]: MsBuild - PackageVersion should still be set if UseFullSemVerForNuGet=false #4321

Open
2 tasks done
KeithWalters opened this issue Nov 19, 2024 · 1 comment
Open
2 tasks done

Comments

@KeithWalters
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.MsBuild

GitVersion version

6.0.5

Operating system

N/A

What are you seeing?

If UpdateVersionProperties is true (default), it should be expected that all version properties should be controlled by GitVersion.

So if we also set UseFullSemVerForNuGet to false, there must still be a GitVersion solution to resolving the version properties.

The observed behaviour is e.g. PackageVersion is no longer being set. Instead, it is defaulting to msbuild standard behaviour. This by default produces packages with version 1.0.0.

I think this may be an issue in GitVersion.MsBuild.targets.

This appears to have regressed going from v5 to v6 as part of the legacy versions removals exercise.

What is expected?

For example, maybe PackageVersion should be set to $(GitVersion_SemVer) when UseFullSemVerForNuGet is false.

This may also be an issue for some other properties, e.g. VersionSuffix.

Steps to Reproduce

  • Init a git repo
  • Create a library csproj in it that has GitVersion.MsBuild as a package reference and defines property UseFullSemVerForNuGet as false
  • dotnet pack
  • See the nuget package produced does not have GitVersion versioning.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

Copy link

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant