11 March 2007
PPUtil: A Utility for Publisher Policy Generation
The conventional method
of creating publisher policy (PP) assemblies becomes cumbersome when
dealing with many assemblies, and many earlier versions of assemblies1.
PPUtil is a configuration-based utility for generating PP for many
assemblies/versions. This tool was authored using .NET 2.0, however,
the resultant PP assemblies can be used with .NET 1.0/1.1-compiled
This work is licensed under a Creative Commons Attribution 3.0 License
PPUtil configurationFile outputDirectory
Common Usage Scenarios
- Redirect a specific earlier version of an assembly to a later version;
- Redirect a range of earlier versions of an assembly to a later version.
In both scenarios, resolution of the redirection for the earlier assembly
versions is limited to major/minor version combinations i.e. build and revision numbers are not considered. This is due to the design of the
publisher policy mechanism itself.
Redirect a specific earlier version of an assembly to a later version
Use the oldVersion attribute of the bindingRedirect element to
specify the specific earlier version to redirect from. The major/minor
component of the oldVersion will typically correspond to the
oldMajorMinorVersion attribute of the publisherPolicy element.
<publisherPolicy oldMajorMinorVersion="1.0" version="18.104.22.168">
<bindingRedirect oldVersion="22.214.171.124" newVersion="126.96.36.199" />
Redirect a range of earlier versions of an assembly to a later version
Use the oldLowestVersion and oldHighestVersion attributes of the
bindingRedirect element to specify the range of earlier versions to
<publisherPolicy oldMajorMinorVersion="2.0" version="188.8.131.52">
- The provided configuration file must include a configuration
section declaration for the publisherPolicy configuration section, as
follows. The utility will also detect the absence of this declaration
and prompt the user accordingly.
<section name="publisherPolicy" type="PublisherPolicyTool.Configuration.PublisherPolicyConfigurationSection, PPUtil" />
- The PP assembly itself is versioned. When there are multiple
versions of a PP assembly available, the version with the highest
number is used. In .NET 1.0/1.1 a bug exists in the assembly loader
whereby when determining the PP assembly with the highest number, the version numbers are sorted in alphabetic order, rather than numeric order.
- The same strong name key used to sign the assembly the PP applies to must be used to sign the PP assembly;
- When GACing a PP assembly, the generated PP configuration file must reside in the same folder as the PP assembly;
- To diagnose binding issues, the binding resolution can be traced using fuslogw or output to disk by modifying registry values;
The idea of using the managed assembly builder APIs for PP generation was derived from Omers publisher policy generation sample.
Generating PP involves specifying the old version (major and minor
version number resolution) of an assembly that the binding policy
within the PP assembly will be applied to. The old version corresponds
to an earlier version of an assembly that is referenced by dependent