Some clarity on policy file creation in .NET

First of all, How to create policy files:

Take example of dll abc.dll.

Policy file should be created with name: policy.major.minor.assemblyname.dll


(Here major and minor are Old dll’s major and minor version, Assembly name is dll name)


So for abc.dll with major and minor version 1.0, you have to create policy file ‘’ and put in GAC.

For abc.dll with major and minor version 1.2, you have to create policy file ‘’ and put in GAC.


Command for creating policy file: al /link:abc.dll.config /out: /keyfile:abc.snk /v:

                                                             al /link:abc.dll.config /out: /keyfile:abc.snk /v:

Now here is some more clarity:

This msdn article says:

(a) If we want to redirect from version to version, according to section "Redirecting Assembly Versions Using Publisher Policy" in above msdn article, they should be in different policy file, according to the "Redirecting Assembly Versions" section, they can go into one policy file.

(b) What’s the name of the Policy DLL should be? In MSDN it said the name is “policy.majorNumber.minorNumber.mainAssemblyName.dll” – then it should be “policy.1.1.mainAssemblyName.dll” or “policy.1.2.mainAssemblyName.dll”?


The above link is an article about redirecting versions in general, rather than specific to publisher policy. We use the same syntax for both config files, as well as publisher policy files. So, when used in a configuration file, the syntax allows for ranges of major/minor “oldVersions”, but the publisher policy infrastructure requires separate files for each major/minor version.


Each major.minor version of an assembly has its own publisher policy file. For example, redirections from version to and from version to version both go into the same file. However, a redirection from version to version goes into a different file.

The above sentence is from the “Redirecting Assembly Versions Using Publisher Policy” section, and is true for publisher policy.


To redirect one version to another, use the <BindingRedirect> element. The oldVersion attribute can specify either a single version, or a range of versions. For example, <bindingRedirect oldVersion="" newVersion=""/> specifies that the runtime should use version instead of the assembly versions between and

The above sentence is from the “Specifying Assembly Binding in Configuration Files” section and is true for configuration files (machine.config/app.config/web.config/host.config etc.)


Hope it clears the doubt and give detail about using policy file and configuration for assembly version redirection.

Disclaimer: This is a personal weblog. The opinions expressed here represent my own and not those of my employer.