Skip to content

AOT Compatible: Add overrideVersion to enforce -Version precedence#7133

Merged
Nigusu-Allehu merged 5 commits intodevfrom
dev-nyenework-AOT-ManifestRead
Feb 17, 2026
Merged

AOT Compatible: Add overrideVersion to enforce -Version precedence#7133
Nigusu-Allehu merged 5 commits intodevfrom
dev-nyenework-AOT-ManifestRead

Conversation

@Nigusu-Allehu
Copy link
Copy Markdown
Member

@Nigusu-Allehu Nigusu-Allehu commented Feb 13, 2026

Bug

Fixes:
related: NuGet/Home#14408

Description

pack allows setting the package version via:

  • -Properties version=<v>
  • -Version <v>

-Version should have the highest priority. Previously, this precedence was enforced using reflection to inspect PackArgs.Version inside Manifest.ReadFrom.

This PR ensures the override is done by directly passing the -Version value down to Manifest,

Previous implementation PR: #6092 , #6361

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.

Comment thread src/NuGet.Core/NuGet.Packaging/PackageCreation/Authoring/PackageBuilder.cs Outdated
@Nigusu-Allehu Nigusu-Allehu changed the title AOT Compatible: Manifest.ReadFrom AOT Compatible: move pack -Version prioritization to a higher PackageBuilder Feb 13, 2026
@Nigusu-Allehu Nigusu-Allehu changed the title AOT Compatible: move pack -Version prioritization to a higher PackageBuilder AOT Compatible: move pack -Version prioritization to PackageBuilder Feb 13, 2026
@Nigusu-Allehu Nigusu-Allehu marked this pull request as ready for review February 13, 2026 21:24
@Nigusu-Allehu Nigusu-Allehu requested a review from a team as a code owner February 13, 2026 21:24
@Nigusu-Allehu Nigusu-Allehu changed the title AOT Compatible: move pack -Version prioritization to PackageBuilder AOT Compatible: Add overrideVersion to to enforce -Version precedence Feb 13, 2026
@Nigusu-Allehu Nigusu-Allehu changed the title AOT Compatible: Add overrideVersion to to enforce -Version precedence AOT Compatible: Add overrideVersion to enforce -Version precedence Feb 13, 2026
@Nigusu-Allehu Nigusu-Allehu self-assigned this Feb 15, 2026
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was hoping there'd be a way to minimize this pattern of overriding, but the PackageBuilder is the first place we read the nuspec, so unfortunately seems like a much bigger refactoring to get rid of this pattenrn.

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.

4 participants