Skip to content

[Pack] Fix version override on nuspec when using token replacement#6361

Merged
martinrrm merged 3 commits intodevfrom
dev-martinrrm-fix-nuspec-version
Apr 1, 2025
Merged

[Pack] Fix version override on nuspec when using token replacement#6361
martinrrm merged 3 commits intodevfrom
dev-martinrrm-fix-nuspec-version

Conversation

@martinrrm
Copy link
Copy Markdown
Contributor

Bug

Fixes: NuGet/Home#14219

Description

This a regression introduced by #6092, [PackArgs stores the version specified in CLI in the Properties variable] (https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Commands/CommandRunners/PackCommandRunner.cs#L700-L706), but customers can also add their custom Properties as an argument.

This Properties are then handled by a token replacement when parsing the nuspec https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/Manifest.cs#L125.

The if I added was looking at the Properties variable from PackArgs instead of the Version property, this caused a version override with just the Version property.

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • [ ] Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@martinrrm martinrrm requested a review from a team as a code owner March 31, 2025 22:07
nkolev92
nkolev92 previously approved these changes Mar 31, 2025
@martinrrm
Copy link
Copy Markdown
Contributor Author

@nkolev92 fixed the test

@martinrrm martinrrm merged commit ccb6097 into dev Apr 1, 2025
20 of 21 checks passed
@martinrrm martinrrm deleted the dev-martinrrm-fix-nuspec-version branch April 1, 2025 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NuGet 6.13.2.1 does no longer support prerelease versions

3 participants