Publisher Policy

Alan has a great discussion on assembly binding policies here ( I'll just talk about publish policy here.

MSDN documents how to create a publisher policy here (

Publisher Policy is carried with a Publisher Policy Assembly. The publisher policy assembly has to be installed into GAC to be visible. The publisher policy assembly's name must follow the rule: Policy.[MajorVersion].[MinorVersion].[AsmName].dll, where AsmName is the assembly your publisher policy intends to affect, and MajorVersion/MinorVersion are the version of the assembly. The publisher policy assembly has to be signed with same key that you use to sign your assembly.

Publisher Policy Assembly can have its own version independent of the original assembly. Say I have an assembly “MyAsm, version=, culture=neutral, PublicKeyToken=0123456789abcdef”, my publisher policy assembly for it will have to be called Policy.1.0.MyAsm, but I can give it any version number, say 123.456.789.0. So my publisher policy assembly's full name will be “Policy.1.0.MyAsm, version=123.456.789.0, culture=neutral, PublicKeyToken=0123456789abcdef”.

If there are multiple publish policy assemblies installed for the original assembly, at runtime, we will pick up the one with the highest version number. Continue with our example above. If I installed both “Policy.1.0.MyAsm, version=,...” and “Policy.1.0.MyAsm, version=123.456.789.0,...”,  since the second one's version number is higher than the first one, we will pick up the second one.

Comments (3)

  1. Blogged about this at the past [1].

    The code in my example is not bullet proof, though.


  2. I am not trying to do what you do. I am only explaining how publisher policy works.

    I wrote this because the other day I got a help email from PSS. Those thing better written in paper so that other people can see it as well.

  3. Not intended on replacing what you said, just adding on it. 🙂

Skip to main content