Version Class

MSBuild

Generates version information based on various algorithms


Namespace: MSBuild.Community.Tasks
Assembly: MSBuild.Community.Tasks (in MSBuild.Community.Tasks.dll)

Syntax

Visual Basic (Declaration)
Public Class Version
    Inherits Task
C#
public class Version : Task
C++
ref class Version : Task
J#
public class Version extends Task
JScript
public class Version extends Task

Example

Get version information from file and increment revision.

 Copy Code
            <Version VersionFile="number.txt" BuildType="Automatic" RevisionType="Increment">
                <Output TaskParameter="Major" PropertyName="Major" />
                <Output TaskParameter="Minor" PropertyName="Minor" />
                <Output TaskParameter="Build" PropertyName="Build" />
                <Output TaskParameter="Revision" PropertyName="Revision" />
            </Version>
            <Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
            
Specify Major and Minor version information and generate Build and Revision.
 Copy Code
            <Version BuildType="Automatic" RevisionType="Automatic" Major="1" Minor="3" >
                <Output TaskParameter="Major" PropertyName="Major" />
                <Output TaskParameter="Minor" PropertyName="Minor" />
                <Output TaskParameter="Build" PropertyName="Build" />
                <Output TaskParameter="Revision" PropertyName="Revision" />
            </Version>
            <Message Text="Version: $(Major).$(Minor).$(Build).$(Revision)"/>
            

Inheritance Hierarchy

System.Object
   Microsoft.Build.Utilities.Task
      MSBuild.Community.Tasks.Version

Thread Safety

Public static (Shared in Visual Basic)staticShared members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

See Also

Syntax based on .NET Framework version 2.0.
Documentation version 1.0.0.0.