Skip to content

Issue with NuGet package prerelease version containing "-" #841

Description

@domaslasauskas

Paket on Windows omits version after and including second "-" in prerelease version number. This results in issue when trying to update from 3.0.0-alpha-0008 to 3.0.0-alpha-0009 as Paket finds MyPackage.3.0.0-alpha.nupkg in cache and just restores previous version instead of new one.

This is was I get in the log when restoring package:

Downloading MyPackage 3.0.0-alpha-0008 to C:\Users\username\AppData\Local\NuGet\Cache\MyPackage.3.0.0-alpha.nupkg

Paket should maintain whole version when storing downloaded packages in cache.

Activity

  1. domaslasauskas commented on May 27, 2015

    @domaslasauskas
    Author

    Having hyphen (actually minus) in pre-release version part is allowed according to SemVer and not forbidden anywhere in NuSpec that I could find. From SemVer:

    A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-].

  2. domaslasauskas commented on May 27, 2015

    @domaslasauskas
    Author

    Issue seems to be originating here:

    var dashSplitted = version.Split('-', '+');

  3. domaslasauskas commented on May 27, 2015

    @domaslasauskas
    Author

    As a workaround one could use paket restore --force.

  4. forki commented on May 27, 2015

    @forki
    Member

    No that's the bootstrapper. The issue is probably in similar code in
    Paket.Core project
    On May 27, 2015 4:42 PM, "Domas Lasauskas" notifications@github.com wrote:

    Issue seems to be originating here:

    var dashSplitted = version.Split('-', '+');

    —
    Reply to this email directly or view it on GitHub
    #841 (comment).

  5. domaslasauskas commented on May 27, 2015

    @domaslasauskas
    Author

    Sorry, here is the code from Paket.Core:

    let dashSplitted = version.Split([|'-'; '+'|])

  6. forki commented on May 28, 2015

    @forki
    Member

    should be fixed. could you please retry?

  7. domaslasauskas commented on May 29, 2015

    @domaslasauskas
    Author

    Now it works fine. Cheers!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions