GAC assembly versioning QFE behavior

G

Guest

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
 
M

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top