Skip navigation

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 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 <codebase> is provided. If so, the directory is checked for the presence of the assembly. In case if the assembly is not located in <codebase> directory the look-up fails.

 

    1. If no <codebase> 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.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish