Home All Groups Group Topic Archive Search About

GAC assembly versioning QFE behavior

Author
24 Mar 2006 6:52 PM
jtyner
I am trying to get QFE (Quick Fix Engineering) working with an assembly
installed in the GAC.  I have two books that claim if two different versions
of the assembly are installed in the GAC -AND- they vary only by revision
number, then the default policy is to load the higher number version.  I am
not able to reproduce this behavior in practice.

My test case is simple.  I wrote a class with AssemblyVersion 1.0.0.1. 
Installed into GAC.  Created a console application that reference this
assembly to verify it works.  I then created a second assembly (with the same
assembly name) and made it version 1.0.0.2.  I installed this into the GAC. 
I verified that both version exist by using the GUI viewer for the GAC.  I
then reran my console application without recompiling.  It is still using the
1.0.0.1 version (the class I built returns the version number so I know this
for certain). 

So my question is why won't the CLR recognize that a newer version is
available and automatically start using it?

Thank You


--
James Tyner
..NET Developer

Author
24 Mar 2006 7:12 PM
Marina Levit [MVP]
Whatever version was compiled against will be used. So if a program was
compiled against version 1.0.0.0, it won't care that 2.0.0.0 is there. It
can only run on 1.0.0.0.

To override that, you can have publisher policy files that 'redirect' to a
newer version.  But this is not automatic.

I'm not sure what books you are using, but either they are wrong, or you are
misinterpreting something.

Show quoteHide quote
"jtyner" <jty***@discussions.microsoft.com> wrote in message
news:539B5606-48BE-42D4-B922-3D4A64CB3239@microsoft.com...
>I am trying to get QFE (Quick Fix Engineering) working with an assembly
> installed in the GAC.  I have two books that claim if two different
> versions
> of the assembly are installed in the GAC -AND- they vary only by revision
> number, then the default policy is to load the higher number version.  I
> am
> not able to reproduce this behavior in practice.
>
> My test case is simple.  I wrote a class with AssemblyVersion 1.0.0.1.
> Installed into GAC.  Created a console application that reference this
> assembly to verify it works.  I then created a second assembly (with the
> same
> assembly name) and made it version 1.0.0.2.  I installed this into the
> GAC.
> I verified that both version exist by using the GUI viewer for the GAC.  I
> then reran my console application without recompiling.  It is still using
> the
> 1.0.0.1 version (the class I built returns the version number so I know
> this
> for certain).
>
> So my question is why won't the CLR recognize that a newer version is
> available and automatically start using it?
>
> Thank You
>
>
> --
> James Tyner
> .NET Developer