![]() |
Languages »
C# »
Utilities
Intermediate
Version Control ToolBy NaveenNayakThis tool is used to modify version information of .NET assemblies. This tool allows you to auto increment or to manually choose Assembly Version, and to increment version information of all assembly files under a selected folder. |
C#, Windows, .NET 1.1VS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
This tool is used to modify version information of .NET assemblies. This tool allows you to auto increment or to manually choose Assembly Version, and to increment version information of all assembly files under a selected folder.
Every time you rebuild your project, Visual studio tends to generate a new version of the assembly. It does this because of the following line in the AssemblyInfo file in the project. According to Jeffrey Richter, the auto increment feature of assembly version is a bug; the original intent was to increment the version of a file, not the assembly.
[assembly: AssemblyVersion("1.0.*")]
The assembly version number is part of an assembly�s identity and plays a key part in binding to the assembly and in version policy. The default version policy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version policy in configuration files (the application configuration file, the publisher policy file, and the computer's administrator configuration file).
The version number has four parts and we can specify all the values or can accept the default build and revision number by using a wild character (*) to automatically generate the Build and Version number where Build Number is set to the number of days since a random, designed start date and Version Number is set to the number of seconds since midnight.
<Major Version>.<Minor Version>.<Build Number>.<Revision>
You can either use auto-increment version number or opt to manually control version number as part of the build process.
| Auto Increment | Manually Control or Static Version |
|---|---|
| Advantages | |
|
|
| Disadvantages | |
|
|
In the AssemblyInfo file for each project, you have the opportunity to set the version number of the assembly. However, in a production environment or to match specific requirements of the development team, you may want to have a unique assembly version for all the assemblies under one application or under one solution.
When the number of projects grows, they will most likely be split into multiple solutions with some of the projects contained in several solutions. So, if you have two applications App-1 and App-2, and both of them use common assemblies C, D and E, then it is nice to have a unique version for all the class library source code that is used to compile solutions App-1 and App-2.

The tool has a configuration file which has got two settings:
Revision: Current revision version which will get updated with the new version when a new version change occurs.
MajorMinorBuild: Current Major-Minor-Build version separated by dot (.) which will get updated with the new value when manual increment of version occurs. <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="CommonConfiguration" type="System.Configuration.NameValueSectionHandler, system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </configSections> <CommonConfiguration> <Revision Value="7"/> <MajorMinorBuild Value="3.2.6"/> </CommonConfiguration> </configuration>

MajorMinorBuild version from the Config file.
Revision version by 1. AssemblyVersion attribute and replaces the old version with the new value in the AssemblyInfo files.
Version tag with the new value in the VersionControl.exe.config file.
MajorMinorBuild version tag with the new value in the VersionControl.exe.config file if Manual Increment is selected.

| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 2 Jun 2005 Editor: Smitha Vijayan |
Copyright 2005 by NaveenNayak Everything else Copyright © CodeProject, 1999-2009 Web15 | Advertise on the Code Project |