Never assume anything, test everything
All these years I assumed that Assembly.Load() would respect version numbers if specified in the FullName string. As I’ve been adding more test coverage to Microsoft.Activities I found that Assembly.Load does not work that way.
Suppose you have an assembly named ActivityLibrary and you deploy V1 but you try to load V2
// This call will succeed and happily load V1 if it finds ActivityLibrary.dllAssembly.Load("ActivityLibrary, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null");
To force Assembly.Load to respect the version number you must sign the assembly
// Try to load V2 this call will fail if it cannot find V2Assembly.Load("ActivityLibrary, Version=126.96.36.199, Culture=neutral, PublicKeyToken=824701d2ab05d638");
So be careful out there and sign your assemblies.
Hehe. Quite a shock huh. I think the rationale used to be that unsigned assemblies can be bin edited in any way you see fit (including version) so you could trust what you find there anyway ...