Repository navigation
Offset the 18.12 insertion prerelease version to avoid immutable-feed collisions - #7728
Merged
Merged
Conversation
… collisions Co-authored-by: Copilot <[email protected]> Copilot-Session: 0becc65b-18b1-48df-a52f-02cc2822e90a
nkolev92
marked this pull request as ready for review
September 21, 2026 16:54
The vs-test pipeline feeds the 65534 sentinel back in as BuildNumber, so the unconditional +100 produced 8.0.0.65634, which overflows the assembly/file version field. Only apply the offset when the result stays <= 65535. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0becc65b-18b1-48df-a52f-02cc2822e90a
martinrrm
approved these changes
Sep 21, 2026
jeffkl
approved these changes
Sep 21, 2026
nkolev92
enabled auto-merge (squash)
September 21, 2026 18:01
Nigusu-Allehu
approved these changes
Sep 21, 2026
3 tasks done
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.
Bug
Fixes:
Description
Why (root cause)
The NuGet client version moved from 7.12 to 8.0, but the Visual Studio package version (
NuGet.VisualStudio/NuGet.VisualStudio.Contracts) stayed at 18.12.The VS version is derived from the NuGet version as
18.((Major - 7) * 12 + Minor), so 7.12 and 8.0 both map to 18.12:7.12→18.((7 - 7) * 12 + 12)= 18.128.0→18.((8 - 7) * 12 + 0)= 18.12The prerelease number (
-rc.N) comes from the pipeline's build-revision counter, which is keyed off the semantic version. Bumping NuGet to 8.0 started a new counter that restarted at low numbers, so 8.0 builds began producing18.12.0-rc.2,-rc.3, ... — the same versions already published (with different content) by the earlier 7.12 builds. The immutable feeds we publish to (devdivnuget-buildand, via BAR + darc, dncengdotnet11) reject those withExistsAndDifferent("Package already exists ... with different content"), which is what broke the insertion/promotion.How (the fix)
Offset the prerelease number by 100 for the 18.12 line, so 8.0 builds produce
18.12.0-rc.10x, safely past the~rc.2xrange already published under 7.12.VsTargetMajorVersion.VsTargetMinorVersion == 18.12). It's the only line that overlapped; other lines keep their plain build number.BuildNumberis supplied. The local dev default (65534, used when noBuildNumberis provided) is a separate branch and is left untouched — bumping it would overflow the UInt16 assembly/file-version field (SemanticVersion.PreReleaseVersion).Reasoning (why this won't recur)
This is a one-off caused by allowing a
.12minor (7.12), which collides with the next major's.0(8.0) under the(Major - 7) * 12 + Minormapping. Going forward we will not ship a.12minor: when 8.11 would otherwise roll to "8.12", we'll ship 9.0 instead. Each VS number then stays unique and monotonic, e.g.8.11 → 18.23,9.0 → 18.24. Because the VS version changes, the counter/version no longer overlaps previously published packages, so no offset will be needed.PR Checklist