Search code examples
dependenciesversionchocolateynuspec

Nuspec snippet to install dependencies' latest version


Introduction

According to this documentation it is possible to specify dependencies including versions per package as follows:

<dependencies>
    <dependency id="Chocolatey" version="0.9.8.20" />
</dependencies>

Question

Which Nuspec snippet needs to be applied in order to install dependencies' latest version?


Solution

  • You should be able to leave the version empty, which will pull the latest version.

    This is documented on the nuget site here:

    http://docs.nuget.org/docs/reference/versioning#Specifying_Version_Ranges_in_.nuspec_Files

    NOTE: This approach is only valid on NuGet Version's of 2.7.2 and earlier. If you are using an newer version of NuGet then use the approaches described in other answers for this question.

    Hope that helps!

    Gary