Click here to Skip to main content
11,790,613 members (62,692 online)
Click here to Skip to main content

Solution level Auto build increment Add-In

, 13 Jun 2008 CPOL 92.4K 65
Rate this:
Please Sign up or sign in to vote.
Auto build version increment addin for Visual Studio 2005 and 2008


  • 14 Jun 2008
    1. Now both or any of two, AssemblyVersion & AssemblyFileVersion can be updated.
    2. Fixed an error where options window doesn't comes up if project contains a setup or any other unsupported project type.
    3. Source control support added. Fix by S. Brozius.
  • 19 Feb 2008
    1. Support for Solution Folders added.
    2. Fixed a error where instead of updating the attribute, the add-in was updating the comment which is auto added by VS just before the actual attribute.


In Visual Studio 2005 or 2008, there is no option for auto incrementing the build numbers on every build. Although many tools exist which enable us to do so, but I do not find them appealing or for daily/frequent use because of many reasons:

  1. Most tools update assembly version on a project level, i.e. you add pre-build or post-build event command lines to a project which call the tool and the tool updates the assembly version number. In such tools, you have to add such events every time you make a project and you cannot make templates for all project types, can you? You also need to specify project path, solution path or AssemblyInfo's path for every project.

  2. Most tools update assembly version based on the solution/project build date. You copy the poject to a new location, your assembly version gets messed up!!

I said "most tools" because there are many tools for this job. I might not have come across one which allows the features my add-in have.

For both the above reasons, I wrote a Visual Studio add-in compatible with both 2005 and 2008. The add-in is compatible with all solutions with either of one or more C# or VB.Net projects or both language projects.


The add-in can be installed by the vsi file which can be downloaded from above.

The add-in is installed in the add-in directory of the version of Visual Studio installed. If you have both 2005 and 2008, it will install in both locations, but it might be possible that the add-in is only added to the add-in directory of Visual Studio 2005. I do not know why it happens, but it does happens on some machines. If this happens, you only need to copy AutoBuildIncrement.dll and AutoBuildIncrement.Addin from the add-in directory of 2005 to that of 2008.


After you install the add-in, whenever you build a project for the first time, a start date variable is added in the project file based on the project creation date. The assembly version is updated based on this variable at every pre build. This behaviour applies to all the solutions you open in the studio, whether new or old.

The auto build numbers are only generated for Revision and Build Number values. You will have to manually update the Major Version and Minor Version values.


The format of the Revision value is:
(months) + (days with a minimum length of 2 with 0 as front padd-ing)

The format of the Build Number value is:
(current hour) + (current minutes)

Example: (C#)
[assembly: AssemblyVersion(]
where the solution was last built after being started since 2 months and 18 days back and was built at 2:02 AM.

Changing the default Features

You can change the default settings of the add-in for any individual solution. Whenever you have a solution opened, you can see the Auto Build Increment Add-in Settings... option in the Tools menu:


When you select this option, a dialog is shown where all the projects in their appropriate solution folders (if they exist, that is) are listed with properties for all the individual projects:


The settings are pretty self explantory.

  • Reset: Reset 'AssemblyInfo' file date after modification: If checked, the last modified date of AssemblyInfo is automatically set to its previous setting after the modifications. (default:true)
  • Start Date: The date on which the project was started on. (default:project creation date)
  • Path: A read only property for displaying full path name of the project. (default: project's full path)

  • Enable: Enable auto build version update for the project. (default:true)



I will love to hear your comments on this add-in. I will also like to know any features and suggestions you people can make for the improvement of the add-in.


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


About the Author

You may also be interested in...

Comments and Discussions

GeneralAutosynchronize the Publish Version Pin
Member 805779920-Jul-11 5:52
memberMember 805779920-Jul-11 5:52 
GeneralCannot download Pin
xeg1226-May-11 0:34
memberxeg1226-May-11 0:34 
GeneralRe: Cannot download Pin
Risath17-Apr-12 1:02
memberRisath17-Apr-12 1:02 
GeneralCreate problm in VS2010 Pin
sumit_harit18-Apr-11 20:52
membersumit_harit18-Apr-11 20:52 
Generalversioning is not reflecting in my case.. do I miss some process in embeding ur tool Pin
Anil.csir17-Feb-11 2:00
memberAnil.csir17-Feb-11 2:00 
Questioncan this work for VS2010 Pin
Tushar Bhatt9-Jun-10 22:22
memberTushar Bhatt9-Jun-10 22:22 
GeneralConvert VS build number to date and time Pin
AndrusM27-Sep-09 21:13
memberAndrusM27-Sep-09 21:13 
GeneralDoesn't always update Pin
Gary Wayne Smith14-Sep-09 8:17
memberGary Wayne Smith14-Sep-09 8:17 
GeneralCannot install the add-in Pin
CreF20-Mar-09 0:12
memberCreF20-Mar-09 0:12 
GeneralRe: Cannot install the add-in Pin
Member 19954238-Apr-09 14:32
memberMember 19954238-Apr-09 14:32 
GeneralRe: Cannot install the add-in Pin
davorin_zg24-Jun-09 10:06
memberdavorin_zg24-Jun-09 10:06 
GeneralUnable to download file Pin
_Hairy_15-Mar-09 2:09
member_Hairy_15-Mar-09 2:09 
AnswerRe: Unable to download file Pin
_Hairy_16-Mar-09 7:15
member_Hairy_16-Mar-09 7:15 
QuestionWeird version numbers Pin
bjoer75114-Dec-08 22:21
memberbjoer75114-Dec-08 22:21 
AnswerRe: Weird version numbers Pin
bjoer75114-Dec-08 23:21
memberbjoer75114-Dec-08 23:21 
GeneralRe: Weird version numbers Pin
Yogesh Jagota15-Dec-08 1:40
memberYogesh Jagota15-Dec-08 1:40 
GeneralNo settings menu entry Pin
mmoore996-Dec-08 8:01
membermmoore996-Dec-08 8:01 
GeneralRe: No settings menu entry Pin
Yogesh Jagota6-Dec-08 11:57
memberYogesh Jagota6-Dec-08 11:57 
GeneralRe: No settings menu entry Pin
mmoore996-Dec-08 19:49
membermmoore996-Dec-08 19:49 
GeneralRe: No settings menu entry Pin
Yogesh Jagota6-Dec-08 22:36
memberYogesh Jagota6-Dec-08 22:36 
GeneralDifferent time zones... Pin
AlexZP4-Dec-08 2:04
memberAlexZP4-Dec-08 2:04 
GeneralRe: Different time zones... Pin
Yogesh Jagota6-Dec-08 11:54
memberYogesh Jagota6-Dec-08 11:54 
GeneralExcellent Plugin Pin
Brandon Ayers3-Nov-08 8:43
memberBrandon Ayers3-Nov-08 8:43 
GeneralRe: Excellent Plugin Pin
Yogesh Jagota6-Dec-08 11:53
memberYogesh Jagota6-Dec-08 11:53 
General2 problems I had with this tool Pin
EuGenius_Krivbass22-Oct-08 23:57
memberEuGenius_Krivbass22-Oct-08 23:57 
GeneralRe: 2 problems I had with this tool Pin
Yogesh Jagota6-Dec-08 11:53
memberYogesh Jagota6-Dec-08 11:53 
QuestionIs VS 2008 / VB supported? Pin
Acidreverb24-Jul-08 5:42
memberAcidreverb24-Jul-08 5:42 
AnswerRe: Is VS 2008 / VB supported? Pin
Yogesh Jagota24-Jul-08 6:10
memberYogesh Jagota24-Jul-08 6:10 
GeneralRe: Is VS 2008 / VB supported? Pin
Acidreverb24-Jul-08 6:16
memberAcidreverb24-Jul-08 6:16 
GeneralRe: Is VS 2008 / VB supported? Pin
Yogesh Jagota24-Jul-08 6:20
memberYogesh Jagota24-Jul-08 6:20 
GeneralRe: Is VS 2008 / VB supported? Pin
Acidreverb24-Jul-08 6:28
memberAcidreverb24-Jul-08 6:28 
QuestionUninstal ? How ? Pin
Yan Terrien17-Jun-08 19:25
memberYan Terrien17-Jun-08 19:25 
AnswerMessage Removed Pin
Yan Terrien17-Jun-08 19:36
memberYan Terrien17-Jun-08 19:36 
GeneralRe: Uninstal ? How ? Pin
Yogesh Jagota17-Jun-08 19:59
memberYogesh Jagota17-Jun-08 19:59 
Jokerealise Pin
ma_sa_ah_pa14-Jun-08 3:19
memberma_sa_ah_pa14-Jun-08 3:19 
GeneralRe: realise Pin
Yogesh Jagota14-Jun-08 3:55
memberYogesh Jagota14-Jun-08 3:55 
GeneralRe: realise Pin
ma_sa_ah_pa14-Jun-08 6:35
memberma_sa_ah_pa14-Jun-08 6:35 
GeneralRe: realise Pin
Yogesh Jagota14-Jun-08 6:52
memberYogesh Jagota14-Jun-08 6:52 
Question? VS.NET 2003 Pin
Synetech14-May-08 11:43
memberSynetech14-May-08 11:43 
AnswerRe: ? VS.NET 2003 Pin
Yogesh Jagota13-Jun-08 22:49
memberYogesh Jagota13-Jun-08 22:49 
QuestionSlick but How Do I See it Work? [modified] Pin
CodeAlien14-May-08 3:53
memberCodeAlien14-May-08 3:53 
AnswerRe: Slick but How Do I See it Work? Pin
Yogesh Jagota13-Jun-08 22:50
memberYogesh Jagota13-Jun-08 22:50 
Generalvery nice work, one suggestion only Pin
Dragan Matic13-May-08 1:29
memberDragan Matic13-May-08 1:29 
NewsRegarding checking out files that are under source-control Pin
S. Brozius23-Apr-08 3:33
memberS. Brozius23-Apr-08 3:33 
GeneralRe: Regarding checking out files that are under source-control Pin
Yogesh Jagota13-Jun-08 22:52
memberYogesh Jagota13-Jun-08 22:52 
GeneralDoes not work Pin
scantwell200621-Apr-08 4:41
memberscantwell200621-Apr-08 4:41 
GeneralRe: Does not work Pin
Yogesh Jagota13-Jun-08 22:53
memberYogesh Jagota13-Jun-08 22:53 
GeneralBuild increment does not work Pin
jpmohr25-Mar-08 2:53
memberjpmohr25-Mar-08 2:53 
QuestionCannot install addin Pin
prso6-Mar-08 23:15
memberprso6-Mar-08 23:15 
AnswerRe: Cannot install addin Pin
Froghut26-Sep-08 2:58
memberFroghut26-Sep-08 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.1509028.1 | Last Updated 14 Jun 2008
Article Copyright 2008 by Yogesh Jagota
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid