Skip to content

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

@KeithWalters

Description

@KeithWalters

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions