Skip to content

fix: use a publish-safe prerelease bound for version ranges#14

Merged
ncipollina merged 3 commits into
mainfrom
fix/version-range-prerelease-bound
Jul 21, 2026
Merged

fix: use a publish-safe prerelease bound for version ranges#14
ncipollina merged 3 commits into
mainfrom
fix/version-range-prerelease-bound

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Summary

The X.0.0-0 upper bound (from #13) broke package publish:

error: Response status code does not indicate success: 400 (The NuGet package
contains an invalid .nuspec file. The errors encountered were: 'The package
manifest contains an invalid Version: '11.0.0-0''...)

-0 is valid SemVer2 and sorts below any real prerelease per spec (numeric
identifiers always have lower precedence than alphanumeric ones) - but
nuget.org's nuspec validator rejects the literal string anyway. Switching to
X.0.0-preview.0 keeps the same guarantee (preview.0 sorts below
preview.1, preview.6.*, and any real preview build via numeric dotted
comparison) while being letter-led, matching the shape of our own lower
bounds, which the validator already accepted without complaint.

Verified locally: dotnet pack on SharpMud.Hosting produces a nuspec with
the new bound and no validation error.

Test plan

🤖 Generated with Claude Code

The X.0.0-0 upper bound broke package publish - nuget.org's nuspec
validator rejected the literal string as an invalid Version
('The NuGet package contains an invalid .nuspec file... invalid
Version: 11.0.0-0'), even though it's valid SemVer2. Switching to
X.0.0-preview.0 keeps the same guarantee (numeric dotted identifiers
compare numerically, so preview.0 sorts below preview.1, preview.6.*,
and any real preview build) while being letter-led like our own
lower bounds, which the validator already accepts without complaint.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the type: fix Bug fix label Jul 21, 2026
ncipollina and others added 2 commits July 21, 2026 16:38
…or net11.0

net10.0 never resolves to a prerelease in practice - nothing in this
repo's dependency graph requests one, and confirmed empirically
(isolated restore against [10.0.10, 11.0.0) stayed on 10.0.10 even
though 11.0.0-preview.* numerically outranks it). No need for a
synthetic bound there.

net11.0's floor is itself a preview, which is what flips NuGet's
per-package "consider prereleases" switch on for the whole graph -
confirmed empirically that this lets a bare next-major bound leak a
12.0.0 preview in once anything else in the graph wants one (NU1107
forced-conflict test). 12.0.0-a keeps the same guarantee as
12.0.0-preview.0 (still letter-led, still sorts below every real
preview/rc label) with a shorter, equally arbitrary marker.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Why net10.0 stays on a plain upper bound while net11.0 needs the -a
marker isn't obvious from the values alone - it hinges on whether
either range's own bounds already reference a prerelease, which flips
NuGet's per-package-ID prerelease consideration for the whole graph.
Recording the reasoning (and the empirical tests that confirmed it)
here so it doesn't need re-deriving next time these get touched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ncipollina
ncipollina merged commit 2627028 into main Jul 21, 2026
7 checks passed
@ncipollina
ncipollina deleted the fix/version-range-prerelease-bound branch July 21, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant