Welcome to MSDN Blogs Sign in | Join | Help

Publisher Policy --- Highest version, which highest?

You can use publisher policy to redirect assembly version.

When there are multiple publisher policy assemblies for the same assembly, the highest version of publisher policy assembly will be used.

Turns out there is a bug in .Net framework v1.0/v1.1, that the alphabetic higest version, instead of the numeric highest version of publisher policy assembly is used.

This bug will be fixed in the next service pack release for .Net framework v1.0/v1.1.

Until then, you have to work around the bug by either making sure only one publisher policy exists for the assembly, or the numeric highest version of publisher policy is also the alphabetic highest version.

This bug does not exist on .Net framework v2.0.

Published Friday, December 16, 2005 8:00 AM by junfeng
Filed under: ,

Comments

# re: Publisher Policy --- Highest version, which highest?

Monday, December 19, 2005 9:03 AM by David Levine
Hi Junfeng,

What an odd bug to have found. Do you have any examples that demonstrate this so we'll know what to watch for? It would be nice to have an example of one so we can write our test code to ensure that our production code does not have the same bug.

Thanks

# re: Publisher Policy --- Highest version, which highest?

Monday, December 19, 2005 10:25 PM by urxlnc
So, you tell me that a string compare is being done instead of a numerical compare???

# re: Publisher Policy --- Highest version, which highest?

Tuesday, December 20, 2005 3:36 AM by junfeng
David,

For example,

for assembly MyAssembly,Version=1.0.0.0,Culture=Neutral,PublicKeyToken=0123456789abcdef

Say there are two publisher policy assemblies for it:
Policy.1.0.MyAssembly, Version=2.0.0.0, ...
Policy.1.0.MyAssembly, Version=10.0.0.0, ...

10.0.0.0 > 2.0.0.0 numerically, but 2.0.0.0 > 10.0.0.0 alphabetically.

We should apply the version 10.0.0.0 publisher policy. Instead, version 2.0.0.0 is applied.

# re: Publisher Policy --- Highest version, which highest?

Tuesday, December 20, 2005 3:37 AM by junfeng
urxInc,

It is not appropriate to disclose the technical detail of the bug. But suffice to say that String compare is not the reason.

# re: Publisher Policy --- Highest version, which highest?

Tuesday, December 20, 2005 11:07 AM by David Levine
Sometimes my hands are faster then my brain - ran into this behavior many years ago when we sorted/compared numeric data that was stored in strings. Been there, had already forgot about it.

Is this a problem that only affects publisher policy? Will binding redirects/codebase hints specified in the app.config be unaffected by this?

# re: Publisher Policy --- Highest version, which highest?

Tuesday, December 20, 2005 3:00 PM by junfeng
The things affected are anything with GAC enumeration.

So technically it also affects GAC Uninstall with partial name. But since the result for GAC Uninstall with partial name is undefined, it does not have any net effect.

# PPUtil: A Utility for Publisher Policy Generation

Sunday, March 11, 2007 4:44 AM by mattonsoftware.com

The conventional method of creating publisher policy (PP) assemblies becomes cumbersome when dealing

New Comments to this post are disabled
 
Page view tracker