Configure and Implementing Assembly Versioning

Versioning of executables are always important in any Business application. We can have different applications that use an assembly with the same name but with a different version. A version number ha

ITPro Today

February 15, 2005

4 Min Read
ITPro Today logo in a gray background | ITPro Today

Versioning of executables are always important in any Business application. We can have different applications that use an assembly with the same name but with a different version. A version number have the following structure. Major.Minor[.Build[.Revision]]

 

This means the  Major and Minor are mandatory and that Build and Revision are optional. If the Revision needs to be used, we need to have Build. The value of Major, Minor, Build, Revision can range from value “0” to “65534”. As mentioned, the version can also be regarded as a Compatibility number, so a change in version can reflect the following.

 

  • Compatible – If only the Revision number changes, Change of revision is seen as a Quick fix engineering update.

 

  • Possible Compatible – If the Build number has changed. There is no guarantee for backward compatibility.

 

  • Incompatible – If Major and or Minor changes.

 

CLR Behaviour in Step-by Step of Versioning

 

  1. CLR Reads the application configuration file, machine.config file and Publisher policy configuration file to determine the correct # of the assembly. Policy configuration file is ignored if the application configuration file has the version resolving in safe mode.

 

  1. If the correct version is established, the CLR checks if the assembly has already been requested in application domain. If that is the case the already loaded assembly is used. This check is based on the assembly's full name, name, version, culture, public key token (strong name).

 

  1. In case the assembly is not loaded yet and is a strong name-based assembly, the CLR checks the GAC.

 

  1. If the assembly is not loaded in GAC then CLR starts it search operation…

 

  1. If checks the configuration file if a is provided. If so, the directory is checked for the presence of the assembly. In case if the assembly is not located in directory the look-up fails.

 

  1. If no is provided, the application base is checked.

 

  1. If there is still no success, and the referenced assembly has a culture, the appropriate culture directories are checked.

 

  1. It checks the privatepath directories and is satisfied with less than a full name.

Thumb Rules

 

If you reference an assembly,  but it does not supply all the fields of the full name, called a partial reference, the CLR will quickly decide that it found the right assembly, even if it turns out not to be the case.  Now the assembly binds with the wrong assembly version.

 

Secondly, if the assembly does not have a Strong name, the CLR will not be checking the correct version, even if you supply  a Version with a reference.

Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like