This project is read-only.

Version Incrementor

Console tool which sets given version to a all projects of the solution. C# projects only are supported. It is implemented as a console application so it can be easilly integrated with any continious integration system.

Configuration

Tool is configured using it's .config file. Open it with your favorite editor. You need to setup 'VersionIncrementor' section.
Specify 'SolutionPath' attribute with path to your solution(.sln) file.

Specify 'Version' attribute if you want to assign a concrete version to your product. Version must be in format 'Major.Minor.Build.Revision'(without braces, each of them should be the int number).
OR
Specify version's automatic incrementation for your projects. Set 'IncrementedComponent' attribute to one of following values: 'Major', 'Minor', 'Build', 'Revision'. The same part of version will be incremented.

Also you can specify VersionGlobalVariable attribute: specified global environment variable will contain latest version of the project.
OR
You can retrieve list of project's versions in your solution to console.
Set RetrieveSolutionVersion to 'true' in config file.

And you can specify loggin setting. NLog is used and additional information can be found at http://nlog-project.org/.

Config samples

  • Sample 1
<VersionIncrementor
SolutionPath="c:\dev\proj1\BuildAll.sln"
IncrementedComponent="Build"
/>
  • Sample 2
<VersionIncrementor
SolutionPath="c:\dev\proj1\BuildAll.sln"
Version="10.5.12.65"
VersionGlobalVariable="MyProjectEnvironmentVariable"
/>
  • Sample 3
<VersionIncrementor
SolutionPath="c:\dev\proj1\BuildAll.sln"
RetrieveSolutionVersion="true"
/>

Addtional information

Tool works in following way:
  • Solution file parsed to find .csproj projects
  • Each of .csproj project parsed to find AssemblyInfo.cs
  • Each AssemblyInfo.cs parsed to find
    • AssemblyFileVersion
    • AssemblyVersion
    • AssemblyInformationalVersion
attributes. AssemblyFileVersion and AssemblyInformationalVersion sets to given version. AssemblyVersion sets to Major.Minor.0.0 version due to conventions http://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin

Last edited Dec 12, 2013 at 3:33 PM by SergeyProkofiev, version 7