Click here to Skip to main content
15,891,567 members
Articles / Programming Languages / C# 4.0

Autoincrement Version in Visual Studio

Rate me:
Please Sign up or sign in to vote.
4.60/5 (13 votes)
12 May 2010CPOL 69K   814   56  
Autoincrement version in Visual Studio
Increments verion number in c# projects. Read agreement below.

vbinc v1.1.10.9 .net4CP version
Autoincrement version in c# projects. Copyright � 2010 vdasus.com

usage: vbinc -[af1234]|[-c]|[-h]
Options
        -a Increment assembly version
        -f Increment file version
        -1 Increment +1.x.x.x (Increments major version)
        -2 Increment x.+1.x.x (Increments minor version)
        -3 Increment x.x.+1.x (Increments build)
        -4 Increment x.x.x.+1 (Increments revision)
        -c Just show current version
        -h this help screen.

Example: vbinc -af34
Increments assembly and file build and revision numbers.

C# have version formar like [major version].[minor].[build].[revision]

Installation: 
- Put vbinc.exe to the root of solution
- Put lines

if  $(ConfigurationName) == Debug $(ProjectDir)vbinc.exe -af4
if  $(ConfigurationName) == Release $(ProjectDir)vbinc.exe -af34

to Pre-Build event command line of each project.

From now, every Debug build will increment [revision] of assembly and file before build of project.
And every Release build will increment [build] and [revision] of assembly and file.

That's all.

-- revision history
1.0 Initial release
1.1 Rewritten from zero :)

* You can use vbinc for all purposes without any time limit. 

* THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT
  WARRANTY OF ANY KIND, EITHER EXPRESSED OR
  IMPLIED, INCLUDING, BUT NOT LIMITED TO,
  THE IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS FOR A PARTICULAR PURPOSE.
  THE ENTIRE RISK AS TO THE QUALITY AND
  PERFORMANCE OF THE SOFTWARE IS WITH YOU.
  SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU
  ASSUME THE COST OF ALL NECESSARY
  SERVICING, REPAIR OR CORRECTION.

* AUTHOR IS NOT RESPONSIBLE
  FOR ANY DAMAGES WHATSOEVER, INCLUDING LOSS
  OF INFORMATION, INTERRUPTION OF BUSINESS,
  PERSONAL INJURY AND/OR ANY DAMAGE OR
  CONSEQUENTIAL DAMAGE WITHOUT LIMITATION,
  INCURRED BEFORE, DURING OR AFTER THE USE
  OF OUR PRODUCTS.

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Lithuania Lithuania
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions