This project is read-only.

Incremental Version

Dec 30, 2011 at 4:49 PM
Edited Dec 30, 2011 at 5:13 PM


I am using auto incremental version simply by using the following:

  <Import Project="C:\Dev\ExtensionPack\MSBuild.ExtensionPack.VersionNumber.targets"/>

It is working fine. But then I have the following:

  <Target Name="AfterBuild">
      <Package Include="$(OutputPath)\$(ProjectName).1.0.nupkg" />
    <Copy SourceFiles="@(Package)" DestinationFolder="C:\Dev\Packages" />

I am creating a Nuget Package using Nuget Power Tools.

But how can I "access" the generated version number so I can use, instead of 1.0, in the file name:

<Package Include="$(OutputPath)\$(ProjectName).1.0.nupkg" />

Thank You,


Dec 30, 2011 at 6:19 PM

You can use 

<Package Include="$(OutputPath)\$(ProjectName).$(MaxAssemblyVersion).nupkg" />


Looks like the task outputs the following


            <Output TaskParameter="MaxAssemblyVersion" PropertyName="MaxAssemblyVersion"/>

<Output TaskParameter="MaxAssemblyFileVersion" PropertyName="MaxAssemblyFileVersion"/>