VersionUpdater Help

VersionUpdater command line help:

VersionUpdater command line help

VersionUpdater command line help

The following command line arguments are supported (all case insensitive, any order):

/File:<value>

<value> is the name of the file to update
defaults to AssemblyVersionInfo.cs

/Attribute:<value>

<value> is the name of the attribute to update
defaults to AssemblyFileVersion

/Major:<value>

<value> is a version major number or * to increment (optional)

/Minor:<value>

<value> is a version minor number or * to increment (optional)

/Build:<value>

<value> is a build number or * to increment (optional)

/Revision:<value>

<value> is a revision number or * to increment (optional)

VersionUpdater command line examples

Here are a few example command line calls to VersionUpdater:
VersionUpdater.exe /file:AssemblyVersionInfo.cs /attribute:AssemblyFileVersion /major:1 /minor:0 /build:* /revision:0
VersionUpdater.exe /build:*

VersionUpdater pre-build event example

Here’s the pre-build event for the TestDox console project:

$(SolutionDir)BuildTools\VersionUpdater.exe
    /file:"$(SolutionDir)AssemblyVersionInfo.cs"
    /build:*

Here’s what it means:

  • there is a folder named BuildTools under the solution directory
  • the BuildTools folder contains VersionUpdater.exe
  • there is an AssemblyVersionInfo.cs file in the solution directory
  • the AssemblyVersionInfo.cs file contains the version number in the AssemblyFileVersion attribute
  • by including the /build:* argument VersionUpdater will increment the build number
When we do a build from VS, the output from the build will include this:
Updating attribute AssemblyFileVersion in file C:\TestDox\AssemblyVersionInfo.cs
Found version: [assembly: AssemblyFileVersion("0.1.105.0")]
Updated version: [assembly: AssemblyFileVersion("0.1.106.0")]

This means that the version has successfully been incremented from 0.1.105.0 to 0.1.106.0

%d bloggers like this: