I can't figured out how to use a publisher policy correctly and I seem to have an similiar issue as related to:
How to make Publisher Policy file redirect assembly request
I've created shared assemply named "SharedAssembly.dll" in version "1.0.0.0", and then in version "2.0.0.0". Both are instaled in GAC (MSIL_GAC, target is .NET Framework 4.5).
I've created following publisher policy file *.xml (redirecting to an older version "1.0.0.0" is on purpose behaviour):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity
name="SharedAssembly"
publicKeyToken="89f6ea550599ca14"
culture="neutral"/>
<bindingRedirect oldVersion="2.0.0.0"
newVersion="1.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Then I've created the publisher policy assembly using the command:
al /link:App.config /out:policy.2.0.SharedAssembly.dll /keyf:F:\VisualStudio\klucz.snk /v:1.0.0.0 /platform:anycpu
Of course, I installed it into GAC.
Then I created a new Console Application, I added reference to the "SharedAssembly.dll", but it doesn't work :(
It still connects with the 2.0.0.0 version of my shared assembly.
I tried many advices, as using fuslogvw.exe (no errors shown), getting rid of the "culture" attribute, etc., but it doesn't help.
I think the problem is not that I want to point to the older version of .dll?
Please help me to fix that issue, cause I've tried so many things and yet I can't make it work.