Hello, I will try to explain this.
Basically, I load the library through reflection using Assembly.LoadFile.
From there, I have an IFace interface that defines a GetStrings method that returns an array of strings.
A dynamically loaded DLL has a class called Class1 that implements IFace.
I need a way to call this conjugate method through a dynamically loaded lib library. I would like to keep it tightly bound, which leaves me wondering what to do. I know that I can use MethodInvoker to call a method, but I'm trying to find a way that I can do something like this:
IFace obj = (IFace)ReflectionAssembly.Class1;
string[] strs = obj.GetStrings();
Any ideas?
source
share