I wrote some sample code like this, all the outputs are the same, which is weird for me,
I guess it makes sense if assembly1 is as same as assemly2, since the assembly information is the same(such as name, assembly version, GUID and etc.)
however, I changed the assembly information and recompile the SampleCodedFormula.dll(then rename it to Changed-assemply-info-and-recompile-SampleCodedFormula.dll), surprisingly, the assembly3 output is still same as assembly1.
assembly1,2,3 are compiled from the same codebase.
Can anyone tell me why the behavior is like this? does it make sense to you?
var domain = AppDomain.CurrentDomain;
var assembly1 = domain.Load(AssemblyName.GetAssemblyName("c:\\SampleCodedFormula.dll"));
Console.WriteLine(assembly1.CodeBase);
Console.WriteLine(assembly1.GetExportedTypes()[0]);
var assembly2 = domain.Load(AssemblyName.GetAssemblyName("c:\\Copied-From-SampleCodedFormula.dll"));
Console.WriteLine(assembly2.CodeBase);
Console.WriteLine(assembly2.GetExportedTypes()[0]);
var assembly3 = domain.Load(AssemblyName.GetAssemblyName("c:\\Changed-assemply-info-and-recompile-SampleCodedFormula.dll"));
Console.WriteLine(assembly3.CodeBase);
Console.WriteLine(assembly3.GetExportedTypes()[0]);