Freigeben über


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.

Comments

  • Anonymous
    December 19, 2005
    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

  • Anonymous
    December 19, 2005
    So, you tell me that a string compare is being done instead of a numerical compare???
  • Anonymous
    December 19, 2005
    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.
  • Anonymous
    December 19, 2005
    urxInc,

    It is not appropriate to disclose the technical detail of the bug. But suffice to say that String compare is not the reason.
  • Anonymous
    December 20, 2005
    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?
  • Anonymous
    December 20, 2005
    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.
  • Anonymous
    March 10, 2007
    The conventional method of creating publisher policy (PP) assemblies becomes cumbersome when dealing