Search code examples
nugetnuget-packagenuget-server

How to create a NuGet package which will not be picked up automatically by Update-packages


I am making a change to some code which I need for one component of my application but which I do not wish to release to the rest of my application due to concern that it might have an unintended side effect.

We currently name our packages major.minor.hotfix.buildnumber with our system on say 1.4.9.600 I'd like to release a package along the lines of 1.4.9-branch.601 which can only be chosen manually and wouldn't be picked up with the Update-packages command.


Solution

  • http://docs.nuget.org/docs/reference/versioning

    You want the section labeled:

    Prerelease Versions

    //Quote//

    Additionally, prerelease versions of your API can be denoted by appending an arbitrary string to the Patch number separated by a dash. For example:

    1.0.1-alpha
    1.0.1-beta
    1.0.1-Fizzleshnizzle
    

    Note that the actual string applied doesn't matter. If there's a string there, it's a prerelease version.

    When you’re ready to release, just remove the dash and the string and that version is considered “higher” than all the prerelease versions. For example, the stable version 1.0.1 is larger than 1.0.1-rc

    //End Quote

    and then the "how to get it" command-line argument

    Install-Package CoolStuff -IncludePrerelease