Creating publisher policies for DLLs

  • Thread starter Thread starter MT
  • Start date Start date
M

MT

We have a .NET dll that we are deploying to our customers using a deployment
project in VS .NET 2003. There is a lot of information about creating
publisher policies on the web, but we have not been successful in creating
one. Here's what the ultimate goal is:
When the DLL is deployed to a customer's system, every application using
this dll must point to the new version. This has to be an automated process
using the deployment project.
This is what we have already done:
1. Created a file called app.config with the following text:
<configuration>
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="name of assembly"
publicKeyToken="public key token"
culture="en-us"/>
<bindingRedirect
oldVersion="1.0.0.0-65535.35535.65535.65535"
newVersion="2.0.1.0"/>
<codeBase version="2.0.0.0"
href="http://www.foo.com/bar.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

We copied this from a howto on gotdotnet.com

2. We signed the dll with our key and created a policy file.
3. We then deployed this dll to the customer's GAC.

However, the customer's application that used an old version of the dll did
not automatically redirect to the new version.

Is there something we are missing?
Does the name of the config file have to be something specific (like
myassembly.dll.config)?
Has anybody ever gotten this to work?

Any help would be appreciated,

Thanks,
MT
 
MT said:
We have a .NET dll that we are deploying to our customers using a deployment
project in VS .NET 2003. There is a lot of information about creating
publisher policies on the web, but we have not been successful in creating
one. Here's what the ultimate goal is:
When the DLL is deployed to a customer's system, every application using
this dll must point to the new version. This has to be an automated process
using the deployment project.
This is what we have already done:
1. Created a file called app.config with the following text:
<configuration>
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="name of assembly"
publicKeyToken="public key token"
culture="en-us"/>
<bindingRedirect
oldVersion="1.0.0.0-65535.35535.65535.65535"
newVersion="2.0.1.0"/>
<codeBase version="2.0.0.0"
href="http://www.foo.com/bar.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

We copied this from a howto on gotdotnet.com

2. We signed the dll with our key and created a policy file.
3. We then deployed this dll to the customer's GAC.

However, the customer's application that used an old version of the dll did
not automatically redirect to the new version.

Is there something we are missing?
Does the name of the config file have to be something specific (like
myassembly.dll.config)?
Has anybody ever gotten this to work?

Any help would be appreciated,

Thanks,
MT

The publisher policy dll in the GAC has to have a specific name
(policy.majorNumber.minorNumber.mainAssemblyName.dll) and you need to be
careful how you add the publisher policy file to the GAC. I've had success
only when the .config file is in the same subdirectory as the .dll when you
add the .dll to the GAC.

If the .config file isn't present when you drag and drop the .dll via the UI
you'll see an error, but I've seen automated tools install a publisher
policy file into the GAC without the .config file being present and then
seeing the behavior you describe.
 
Back
Top