Home > VersionUpdater > An easy way to automatically increment build numbers in .NET

An easy way to automatically increment build numbers in .NET

Sometimes you just want something simple…

VersionUpdater will update the 4 part version number for .NET assemblies in your project(s) according to how you tell it to. The format of the 4 part version number is:

  • Major
  • Minor
  • Build
  • Revision

There are a couple of different approaches to how the version number can be updated. This post assumes you’re mostly interested in incrementing the Build segment of the version number each time you run a build process.

Automated builds?

Within your build process you will want to increment the Build segment of the version number to match the build number. VersionUpdater can be instructed to update the project/solution level assembly info file to set an explicit version number or to automatically increment some or all of the version number segments.

Manual builds on smaller projects

If you’re working on a small project and your build process basically consists of Ctrl+Shift+B then VersionUpdater can be called from your pre-build event to automatically update the Build segment of the assembly version. This gives you a rolling number that increments for each build. You may also choose to only do this in Release configuration if that suits your needs.

Download VersionUpdater and give it a try!

Advertisements
  1. David L
    November 10, 2011 at 2:39 pm

    In Updater.UpdateFile, if you change your IF to …

    if ((content.Contains(“[assembly: ” + attribute + “(“)) ||
    (content.Contains(“<Assembly: " + attribute + "(")))

    … then it works for VB modules as well.

    (I apologize for reverse-engineering your code. I just started a new job, I was given a day to consolidate the version #s on a fairly large solution [50+ projects], and I didn't realize until the end of the day there were a couple of VB projects mixed in.)

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: