3
votes

I have a NuGet nuspec file responsible for creating a NuGet package from HelloWorld.Main.dll and the package version is incremented each time I make a change in HelloWorld.Main project.

What if I want to get the version incremented whenever I make a change to any other project in my solution.

<?xml version="1.0" encoding="utf-8"?>
     <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
     <metadata>
         <id>HelloWorld.Main</id>
         <version>$version$</version>
         <title>$title$</title>
         <authors>$author$</authors>
         <owners>$author$</owners>
         <requireLicenseAcceptance>false</requireLicenseAcceptance>
         <description>$description$</description>
         <releaseNotes />
         <copyright>Copyright 2013</copyright>
         <tags>HelloWorld</tags>
         <dependencies>
         <dependency id="HelloWorld.Helpers" version="[0.0.7,0.1)" />
         </dependencies>
     </metadata>
 </package>
1

1 Answers

4
votes

You can increment version number somewhere else and pass it to nuget via param:

NuGet Pack MyPackage.nuspec -Version 1.2.0