I did this before, although from assemblies that were not in the GAC: Mine loaded from byte arrays, but I could easily have different versions of the same assembly.
The solution was to handle the AssemblyResolve event for the AppDomain so you can make sure that the required assembly will be returned. In your case, this can be quite simple, since you only need to make this specific call. The rest of the time, you take the default value and do not even process it at all.
A possible example would be:
public DoSomething() {
This is pretty rude, but it will give an idea of ββthis process - you will cope with assemblyresolve and return what you need. The contents of your handler will probably be different, because I'm not sure if your assembly will be in the CurrentDomain.GetAssemblies() list.
There are probably more subtle assmeblyresolve examples out there that will handle the GAC version for you.
Notes. This was used in .Net 3.5, not 4, but worked for different versions. You might need @Jean's solution to load 3.5 builds into 4.
Jon egerton
source share