mardi 18 octobre 2016

Load Assembly and create class using Reflection

I could not find a way of creating a class object from given type and assembly definition using reflection. For my case, I have a string containing class and assembly name and need to create the object:

string str = "My.Assembly.Namesapce.MyClass, My.Assembly.Namesapce, Version=4.0.0.0, Culture=neutral, PublicKeyToken=84474dc3c6524430";
MyClass objClass = --SOME CODE TO USE  STR AND CREATE MyClass--

I have tried to split and create class but that is not very good way of doing it.





Aucun commentaire:

Enregistrer un commentaire