dimanche 11 septembre 2016

Find (scan) specific classes from assemblies and create instance from them in .NET Core?

I have some assemblies that they have classes with specific interface on it

class A : IBase // .dll 1
class B : IBase // .dll 2
...

I want to find these classes from specific directory and create instance from them .

IBase a = new A(); // comes from .dll 1
IBase b = new B(); // comes from .dll 2
...

How can I get this in .NET Core ?





Aucun commentaire:

Enregistrer un commentaire