Assembly.Load strange behavior RRS feed

  • Question

  • I have "Microsoft.Web.Services2.dll" V2.0.3.0 in my GAC of two machines.

    I am running this line in both of them:

    Assembly.Load("Microsoft.Web.Services2, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35");

    (note the version is and not

    On one machine this fails (as I would expect). In another it works and the loaded dll is Actually on this machine every version lower than 3 works (and loads 3, from the GAC).

    How can you explain this?

    WCF Security, Performance And Testing Blog
    Wednesday, December 30, 2009 5:09 PM


  • That machine must have a publisher policy file in place redirecting the old version to the version.  This allows component publishers to redirect requests of older assemblies to a newer, fixed version (with the same binary compatible API).

    For details on how this works, see this page within How the Runtime Locates Assemblies.
    Reed Copsey, Jr. - http://reedcopsey.com
    • Marked as answer by Yaron Naveh Wednesday, December 30, 2009 9:00 PM
    Wednesday, December 30, 2009 6:20 PM