Valid TaskActions are:

Increment (Required: File Optional: Increment Output: Value)

Reset (Required: File Optional: Value Output: Value)

Remote Execution Support: No

Namespace: MSBuild.ExtensionPack.FileSystem
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 3.5.0.0

Examples

Xml Copy imageCopy
<Project ToolsVersion="3.5" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <Target Name="Default">
        <!-- Perform a default increment of 1 -->
        <MSBuild.ExtensionPack.FileSystem.FileVersion TaskAction="Increment" File="C:\a\MyVersionfile.txt">
            <Output TaskParameter="Value" PropertyName="NewValue"/>
        </MSBuild.ExtensionPack.FileSystem.FileVersion>
        <Message Text="$(NewValue)"/>
        <!-- Perform an increment of 5 -->
        <MSBuild.ExtensionPack.FileSystem.FileVersion TaskAction="Increment" File="C:\a\MyVersionfile2.txt" Increment="5">
            <Output TaskParameter="Value" PropertyName="NewValue"/>
        </MSBuild.ExtensionPack.FileSystem.FileVersion>
        <Message Text="$(NewValue)"/>
        <!-- Reset a file value -->
        <MSBuild.ExtensionPack.FileSystem.FileVersion TaskAction="Reset" File="C:\a\MyVersionfile3.txt" Value="10">
            <Output TaskParameter="Value" PropertyName="NewValue"/>
        </MSBuild.ExtensionPack.FileSystem.FileVersion>
        <Message Text="$(NewValue)"/>
    </Target>
</Project>

Inheritance Hierarchy

System..::..Object
  Microsoft.Build.Utilities..::..Task
    MSBuild.ExtensionPack..::..BaseTask
      MSBuild.ExtensionPack.FileSystem..::..FileVersion

See Also