Incremental Version

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

Hello,

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">
    <ItemGroup>
      <Package Include="$(OutputPath)\$(ProjectName).1.0.nupkg" />
    </ItemGroup>
    <Copy SourceFiles="@(Package)" DestinationFolder="C:\Dev\Packages" />
  </Target>

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,

Miguel

Coordinator
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"/>

 

Mike