I would like to load an assembly from the GAC, but I don't know its version. I do know the AssemblyName
and PublicKeyToken
.
string dllname="gacname"; //Name os assembly
AssemblyName name = new AssemblyName(string.Format("{0}, PublicKeyToken=dd3cb1c9aae9ec97" ,dllname));
var x = Assembly.Load(name);
This code throws an exception:
Could not load file or assembly ...
The dllname
is correct, because it works fine when I specify the version in the AssemblyName
.
Is it possible to do this without knowing the version?