3

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 Answer 1

4

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

NuGet Pack MyPackage.nuspec -Version 1.2.0
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.