Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

major version. minor version. build number. revision

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).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top