Assemblies versionning details

  • Thread starter Thread starter Arnaud Debaene
  • Start date Start date
A

Arnaud Debaene

Hello all,

In this article (http://msdn.microsoft.com/msdnmag/issues/01/03/buildapps2/),
it is said in the "Version numbers" paragraph :

"However, if the runtime sees that there are [in the GAC] two
assemblies with the same major.minor version, the runtime will bind to
the assembly with the latest build.revision. In other words, the
runtime will bind to version 2.5.719.5 even if the application was
bound to version 2.5.100.7 when it was built"

Although this article is written by Richter himself, it is quite old
and based on beta 1 version of the framework. I couldn't locate any
other article that explains clearly what part of the version number is
used when binding to an assembly : is it all the four numbers of the
version, or just the major / minor pair?

Say I have my A.exe app installed, which installs "shared.dll"
assembly version 1.5.0.1 in the GAC. What happens if, afterwards, my
B.exe application installs shared.dll version 1.5.0.2? Which version
of shared.dll will be used by A.exe? It can makes a huge difference on
versionning policy when building shared assemblies!

Thanks,

Arnaud
MVP - VC
 
Arnaud,
I couldn't locate any
other article that explains clearly what part of the version number is
used when binding to an assembly : is it all the four numbers of the
version, or just the major / minor pair?

All four.

Say I have my A.exe app installed, which installs "shared.dll"
assembly version 1.5.0.1 in the GAC. What happens if, afterwards, my
B.exe application installs shared.dll version 1.5.0.2? Which version
of shared.dll will be used by A.exe?

Nothing should happen. A.exe continues to load 1.5.0.1.



Mattias
 
Arnaud said:
Although this article is written by Richter himself, it is quite old
and based on beta 1 version of the framework. I couldn't locate any

I guess this was a beta 1 'feature'.
other article that explains clearly what part of the version number is
used when binding to an assembly : is it all the four numbers of the
version, or just the major / minor pair?

Unless you use a config file or a policy file, the process picks up the
*exact* version mentioned in the manifest of the process
Say I have my A.exe app installed, which installs "shared.dll"
assembly version 1.5.0.1 in the GAC. What happens if, afterwards, my
B.exe application installs shared.dll version 1.5.0.2? Which version
of shared.dll will be used by A.exe? It can makes a huge difference on
versionning policy when building shared assemblies!

it will load 1.5.0.1, if you remove this version from the GAC then a
FileLoadException will be thrown - the runtime will not attempt to load
1.5.0.2

Richard
 
Hi Arnaud,

The following MSDN topic could also help you understand the side-by-side
execution. Side-by-side execution is the ability to install multiple
versions of code so that an application can choose which version of the
common language runtime or of a component it uses. Subsequent installations
of other versions of the runtime, an application, or a component will not
affect applications already installed.

"Using Side-by-Side Execution"
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconside-by-sideexecut
ion.asp?frame=true

Hope that helps.

Best regards,
Yanhong Huang
Microsoft Online Partner Support

Get Secure! ¨C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top