July 2009 Blog Posts
Actually, as many as you want, just call
Assembly.Load(File.ReadAllBytes(@"SomeFolder\MyLib.dll"));
in a loop. All copies will have their code base set to the currently executing assembly. Code base specifies the physical location of an assembly. By executing the following line
Assembly.LoadFrom(@"SomeOtherFolder\MyLib.dll");
we load another copy but this time from completely different location. Let’s add one more:
Assembly.Load("MyLib");
In this way we end up with several copies and 3 different code bases inside of the same AppDomain. This happens because each assembly is loaded into different load context. You can read about that here. Why is it like that? To be honest I’ve found no clear explanation....
It’s been a very busy and exciting half a year for me and that’s the main reason why my blog WAS temporarily abandoned. Before Christmas 2008 I left Ireland for good. I’ve spent over 3 years of my life there and I don’ regret anything. I’ve met many amazing people and I’ve learnt a lot from both professional and personal perspectives. But my Irish time was up and it was time to move on. I’ve decided to move to Sydney in Australia and become one of the Readifarians. I started my new job at the beginning of April...