// path1 and path2 point to different copies of the same assembly on disk:
Assembly assembly1 = Assembly.LoadFrom(path1);
Assembly assembly2 = Assembly.LoadFrom(path2);
// These both point to the assembly from path1, so this is true
Console.WriteLine(string.Compare(assembly1.CodeBase, assembly2.CodeBase) == 0);
Why assembly.Code is the same as assembly2.CodeBase?
Possibly it’s due to this (from the docs for
Assembly.LoadFrom):Have you checked whether
assembly1andassembly2are actually identical references?