Repository navigation
Description
Description
In NuGet, the floating version * means "the latest stable release" and *-* means "the latest version including prereleases". Verso treats both the same way: *-* returns the latest stable release, and any newer prerelease is ignored.
Reproduced with a public package
System.CommandLine on nuget.org currently has:
latest stable 2.0.12
latest overall 3.0.0-rc.1.26425.128
A cell containing
#r "nuget: System.CommandLine, *-*"
resolves to 2.0.12. The Installed Packages list shows "System.CommandLine, 2.0.12", and the staging folder confirms it:
%TEMP%\verso-nuget-packages\net10.0-v2\System.CommandLine\2.0.12
Expected: 3.0.0-rc.1.26425.128.
Why this matters
It fails silently. There is no warning and no error - the notebook runs, the reference looks satisfied, and you only notice if you check which version actually got loaded. A notebook written to track prerelease builds quietly runs against an older stable one instead, which is exactly the opposite of what *-* was asked for.
That is the normal reason to write *-*: following the current prerelease of an internal CI feed, rather than editing a pinned version in every notebook on every build. The workaround is to pin each reference to an exact version, which removes the point of the floating range and means every notebook has to be touched whenever the version moves on.
Likely cause
It looks like the prerelease flag of the parsed range is not carried into the version selection. NuGet's VersionRange.Parse("-") produces a range whose IncludePrerelease is true; if the candidate list is filtered on IsPrerelease == false, or if the range is normalised to * before the candidates are filtered, the observed behaviour follows.
Worth checking at the same time whether other prerelease-bearing ranges are affected, for example [1.0.0-alpha,) or 1.0.0-*.
Steps to Reproduce
-
Create a new .verso notebook.
-
Add this cell and run it:
#r "nuget: System.CommandLine, *-*" using System.IO; foreach (var d in Directory.GetDirectories( Path.Combine(Path.GetTempPath(), "verso-nuget-packages", "net10.0-v2", "System.CommandLine"))) Console.WriteLine(Path.GetFileName(d)); -
Observed output:
2.0.12and Installed Packages shows "System.CommandLine, 2.0.12".
-
Expected output:
3.0.0-rc.1.26425.128which is the latest version of that package on nuget.org, as returned by
https://api.nuget.org/v3-flatcontainer/system.commandline/index.json
(latest stable there is 2.0.12, so*and*-*are currently
indistinguishable in Verso).
Error Output
None. This is the problem: the wrong version is selected silently, with no
warning and no error.
Component
NuGet Package Resolution
Frontend
VS Code
Verso Version
1.2.2
.NET Version
10.0.301
Operating System
Windows 11
Notebook Snippet
#r "nuget: System.CommandLine, *-*"
using System.IO;
foreach (var d in Directory.GetDirectories(
Path.Combine(Path.GetTempPath(), "verso-nuget-packages", "net10.0-v2", "System.CommandLine")))
Console.WriteLine(Path.GetFileName(d));
// observed: 2.0.12
// expected: 3.0.0-rc.1.26425.128Loaded Extensions
none
Severity
Medium - workaround exists but it's disruptive
Checklist
- I searched existing issues and this hasn't been reported yet
- I can reproduce this with no third-party extensions loaded
Activity
mna-intend commentedon Oct 7, 2026
A note on the same code path: Verso already ships NuGet.Versioning 6.9.1 (it is listed in host/Verso.Host.deps.json), so the full range syntax can come from the library instead of being special-cased:
VersionRange.Parse already understands "" and "-*" with the correct IncludePrerelease flag, which is the bug reported above, and it covers the interval notations from
https://learn.microsoft.com/nuget/concepts/package-versioning#version-ranges in the same step:
Resolving through the library would make Verso behave the same way as dotnet restore and MSBuild PackageReference for every notation at once, rather than matching them one by one.