You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support pre-release packages with floating versions. Version="*-*" and similar. #912
Status - Implemented in version 5.6 of NuGet, 16.6 of Visual Studio and 3.1.300 of the .NET Core SDK.
Original Issue:
Consider a project.json specification such as
{
"A: "1.0.*"
}
If the only packages in the feed are prerelease packages such as A.1.0.0-alpha, A.1.0.1-beta, the restore fails stating it was unable to resolve package A.
[anangaur] Adding the requirement as evolved during the discussions:
As Noel, who uses NuGet packages in PackageReference based projects,
I would like to use floating versions that only resolves to stable versions of the package (Current behavior)
I would like to use floating version that can resolve to the latest version even if the latest happens to be a pre-release version.
I should be able to use both the braces/regex formats i.e. 1.* or [1.0.0, 2.0.0) that can include pre-release versions
I would like to additionally define whether I want to resolve to rc, beta, alpha or all pre-releases.
I looked at how NPM does it, and it looks like it will not allow pre-releases with such a specifier.
We need to work on how we extend our syntax to support ranges (do we go with something similar to npm? Do we also allow 1.*-*? Do we allow for version ranges ala packages.config/nuspec?
Hi all, I saw that the "Support pre-release packages with floating versions" changes are implement in the 5.6.0 nuget version and I tried the latest 5.6.0 preview2 version but the floating version format "-" is still considered as an invalid version format.
Am i missing something? Or do i have to wait for the full 5.6.0 release?
changed the title [-]Support pre-release packages with floating versions[/-][+]Support pre-release packages with floating versions. Version = "*-*" and similar.[/+]on May 19, 2020
changed the title [-]Support pre-release packages with floating versions. Version = "*-*" and similar.[/-][+]Support pre-release packages with floating versions. Version="*-*" and similar.[/+]on May 19, 2020
@sm-g Floating versions are only allowed in the min part of the range, they cannot be part of the upper bound, so your example version range is not supported.
Activity
yishaigalatzer commentedon Jul 9, 2015
We can discuss this for 3.2
yishaigalatzer commentedon Nov 23, 2015
I looked at how NPM does it, and it looks like it will not allow pre-releases with such a specifier.
We need to work on how we extend our syntax to support ranges (do we go with something similar to npm? Do we also allow
1.*-*? Do we allow for version ranges ala packages.config/nuspec?pranavkm commentedon Nov 23, 2015
AFAIK it stops when it sees the
*. @emgarten would know this better.yishaigalatzer commentedon Nov 23, 2015
Yes it does, my comment was a question about what we should do in the future :)
123 remaining items
karann-msft commentedon Feb 12, 2020
Update - here is a link to the spec - https://github.com/NuGet/Home/wiki/Support-pre-release-packages-with-floating-versions
We will continue to use this issue for feedback.
nkolev92 commentedon Feb 20, 2020
Pull Request out based on the above linked design NuGet/NuGet.Client#3247.
jgalarse commentedon Apr 15, 2020
Hi all, I saw that the "Support pre-release packages with floating versions" changes are implement in the 5.6.0 nuget version and I tried the latest 5.6.0 preview2 version but the floating version format "-" is still considered as an invalid version format.
Am i missing something? Or do i have to wait for the full 5.6.0 release?
Visual Studio 2019 16.5.4
Nuget 5.6.0 Preview2
anangaur commentedon Apr 16, 2020
@nkolev92 can you point to the version of the tools where this works?
nkolev92 commentedon Apr 16, 2020
It will be a part of the 5.6 release/16.6 of Visual Studio.
It will be in preview 3 of both which is supposed to ship next week.
jgalarse commentedon Apr 16, 2020
@anangaur ,@nkolev92 Thank you so much!!
[-]Support pre-release packages with floating versions[/-][+]Support pre-release packages with floating versions. Version = "*-*" and similar.[/+][-]Support pre-release packages with floating versions. Version = "*-*" and similar.[/-][+]Support pre-release packages with floating versions. Version="*-*" and similar.[/+]sm-g commentedon Jul 8, 2020
@nkolev92 Are versions like
(,1.3.*]supported? NuGet.CommandLine 5.6 can not restore csproj with such version.nkolev92 commentedon Jul 8, 2020
@sm-g Floating versions are only allowed in the min part of the range, they cannot be part of the upper bound, so your example version range is not supported.