Following is a small part of an email i sent to some of our developers
to handle this same issue. Hopefully it gives you enough information to
at lease figure out where to look.
----------------------------
There is a way to create and register an item called a Publisher Policy
Assembly. You can then redirect all users of a dll to a new version.
Following are the steps.
First create the configuration file. This has the same information that
I previously put in the application configuration file.
<configuratio n>
<runtime>
<assemblyBindin g xmlns="urn:sche mas-microsoft-com:asm.v1">
<dependentAssem bly>
<assemblyIdenti ty name="StrongLib rary"
publicKeyToken= "6b5322bd2869c3 15"
culture="neutra l" />
<bindingRedirec t oldVersion="1.0 .0.0"
newVersion="1.0 .0.1"/>
</dependentAssemb ly>
</assemblyBinding >
</runtime>
</configuration>
Then make a Publisher Policy Assembly. This is done using the assembly
linker tool.
al /link:publisherP olicyFile /out:publisherPo licyAssemblyFil e
/keyfile:keyPair File
In this command:
The publisherPolicy File argument is the name of the publisher policy file.
The publisherPolicy AssemblyFile argument is the name of the publisher
policy assembly that results from this command. The assembly file name
must follow the format: policy.majorNum ber.minorNumber .mainAssemblyNa me.dll
The keyPairFile argument is the name of the file containing the key
pair. You must sign the assembly and publisher policy assembly with the
same key pair.
The following is the command I used in my prototype.
al /link:policy.con fig /out:policy.1.0. StrongLibrary.d ll
/keyfile:StrongL ibrary.snk
You then use the gacutil to register the policy.
gacutil /I policy.1.0.Stro ngLibrary.dll
---------------------------------------------------
Hope that helps
Leon Lambert
jtyner wrote:
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 version
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 won't the CLR recognize that a newer version is
available and automatically start using it?
Thank You
James Tyner
.NET Developer