Details of Assembly version

10,019

Solution 1

As stated in the file itself:

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
//[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

By changing this the following way:

// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.0.*")]
//[assembly: AssemblyVersion("1.0.0.0")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

You'll get an auto set of the last two sections (Build Number and Revision). And this auto-increment works as follows:

  • Build Number: Days since 1.1.2000
  • Revision: Seconds since midnight divided by two

And last but not least if you use Subversion for SourceControl you can create a template file (copy of the same file with other name) where you replace on a desired place something like this:

[assembly: AssemblyVersion("1.0.$WCREV$.0")]

And within your pre-built event of your project you'll enter something like this:

SubWCRev "$(ProjectDir)\" "$(ProjectDir)Properties\AssemblyInfo.template.cs" "$(ProjectDir)Properties\AssemblyInfo.cs"

To get your current Subversion revision number into the version information of your application.

Solution 2

major version. minor version. build number. revision

Solution 3

From AssemblyInfo.cs, the four numbers mean:

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision

Solution 4

The version number is made up of four segments; Major, Minor, Build and Revision.

The first two segment Major and Minor are the version number that the user will normally see, major changes are for very large change, whilst minor are incremented for each brand new release to the user.

The second two segments Build and Revision are an extension to the version number that are really for IT people. By default these are the number of days since a random, designated start date, and the revision based on the number of seconds since midnight.

We actually use a version of the date for the build value and releases within a single day for the revision (although we will probably move this to being our svn revision number).

Share:
10,019
Muhammad Akhtar
Author by

Muhammad Akhtar

Senior Software Engineer MCTS - Microsoft Certified Technology Specialist toakhtar - at - hotmail - .com Cell # : 00923014728930 View my MCP Certifications http://stackoverflow.com/tags/asp.net/topusers http://stackoverflow.com/search?tab=votes&q=user%3a97010%20%5basp.net%5d http://www.linkedin.com/profile/view?id=48514505&trk=tab_pro

Updated on June 05, 2022

Comments

  • Muhammad Akhtar
    Muhammad Akhtar almost 2 years

    we will find Assembly version from Assembly.cs in every library.

    [assembly: AssemblyVersion("1.0.0.0")]
    [assembly: AssemblyFileVersion("1.0.0.0")]
    

    My question is what is 1.0.0.0 meant by this?

    Thanks

  • Dave
    Dave about 13 years
    Small correction: Revision = Seconds since midnight divided by two. The reason is since there are 86400 seconds in a day and versions are restricted to 16 bit integers, you only get a maximum of 65535 seconds in a day.