Skip to content

Support pre-release packages with floating versions. Version="*-*" and similar. #912

Closed
NuGet/NuGet.Client
#3247

Description

@pranavkm

UPDATE: final solution details

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.

Link to spec - https://github.com/NuGet/Home/wiki/Support-pre-release-packages-with-floating-versions
Status - Implemented in version 5.6 of NuGet, 16.6 of Visual Studio and 3.1.300 of the .NET Core SDK.

Activity

  1. added this to the milestone on Jul 9, 2015
  2. yishaigalatzer commented on Jul 9, 2015

    @yishaigalatzer

    We can discuss this for 3.2

  3. added
    Type:DCR
    and removed on Jul 9, 2015
  4. yishaigalatzer commented on Nov 23, 2015

    @yishaigalatzer

    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?

  5. modified the milestones: , on Nov 23, 2015
  6. added
    Priority:2
    on Nov 23, 2015
  7. pranavkm commented on Nov 23, 2015

    @pranavkm
    ContributorAuthor

    Do we also allow 1.-

    AFAIK it stops when it sees the *. @emgarten would know this better.

  8. yishaigalatzer commented on Nov 23, 2015

    @yishaigalatzer

    Yes it does, my comment was a question about what we should do in the future :)

  9. 123 remaining items

  10. karann-msft commented on Feb 12, 2020

    @karann-msft
    Contributor
  11. nkolev92 commented on Feb 20, 2020

    @nkolev92
    Member

    Pull Request out based on the above linked design NuGet/NuGet.Client#3247.

  12. jgalarse commented on Apr 15, 2020

    @jgalarse

    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

  13. anangaur commented on Apr 16, 2020

    @anangaur

    @nkolev92 can you point to the version of the tools where this works?

  14. nkolev92 commented on Apr 16, 2020

    @nkolev92
    Member

    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.

  15. jgalarse commented on Apr 16, 2020

    @jgalarse

    @anangaur ,@nkolev92 Thank you so much!!

  16. changed the title [-]Support pre-release packages with floating versions[/-] [+]Support pre-release packages with floating versions. Version = "*-*" and similar.[/+] on May 19, 2020
  17. 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
  18. added and removed
    Type:DCR
    on May 21, 2020
  19. sm-g commented on Jul 8, 2020

    @sm-g

    @nkolev92 Are versions like (,1.3.*] supported? NuGet.CommandLine 5.6 can not restore csproj with such version.

  20. nkolev92 commented on Jul 8, 2020

    @nkolev92
    Member

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Functionality:RestorePriority:1Style:PackageReferenceType:Feature

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions