How to initialize one class from a library?
- by daemonsvk
Hi,
I have a few classes in the class library (separate assembly). I referenced it to my project and I want to initialize one specific class from that library. I know only its name. All of the classes implements one interface.
And here comes the problem.
My code so far:
using MyLibrary;
...
IMyInterface dll = Activator.CreateInstance("MyLibrary", "MyLibrary.NameOfClass") as IMyInterface;
But dll is always null.
Any ideas?
Thanks