Side by side execution of an assembly without touching the client application or application settings.
Consider the scenario where there is an assembly vendor. You are using version 126.96.36.199 of that assembly.
Now that assembly vendor has released a new version of the assembly 188.8.131.52.
This new version is to be used by the existing client without recompiling it or changing the config file.
The solution to this problem is the Publisher Policy File.
The assembly vendor will give the setup for the new version(184.108.40.206) of the assembly and one more assembly contailing the Publisher Policy File. Once These two assemblies are put in GAC the client is ready to use the new version of the assembly.
The Publisher policy can be created in three steps:
Create a config file (Publisher Policy File)
The typical structure of the file
<!-- The above parameter values can be taken from the assembly properties after puting it in GAC-->
<!-- Redirecting to version 220.127.116.11 of the assembly. -->
Save this file as Policy.config.
Next to create Publisher Policy Assembly from the above config file
Use al.exe (Assembly Linker) to create the assembly.
I created it as folows.
AL /LINK:Policy.config /OUT:policy.1.0.SbySExeAssembly.dll /keyfile:snkFile.snk
Policy.config -- COnfig file wich containd redirection directives for the assembly
policy.1.0.SbySExeAssembly.dll -- Name of the Publisher Policy Assembly File
this name must have the specified format
policy.majorNumber.minorNumber.mainAssemblyName.dll (najor and minor numbers of the old assembly)
snkFile.snk -- keypiar file generated using sn.exe and the same file used to strong name the main assemblies.
Add the publisher policy assembly to the global assembly cache
gacutil /i policy.1.0.SbySExeAssembly.dll
The client starts using the new assembly.
Note: To strong name your assembly set the <Assembly: AssemblyKeyFile("..\..\bin\snkFile.snk")> in your Assembly.vb file
To Test the attachment
Unzip the Files.Zip
Put the SbySExeAssembly.dll (v18.104.22.168) which in 22.214.171.124 folder in GAC and run the client
Next put SbySExeAssembly.dll(v126.96.36.199) in GAC, policy.1.0.SbySExeAssembly.dll in GAC run the client.
Check the output in both the cases