I'm not sure this is possible, and the existing answers to this question seem to imply that you need to know the namespace.
I am trying to activate a type, but would prefer to avoid specifying the Type's namespace. Is this possible? Of course I would know the Assembly ahead of time.
string qualifiedName = Assembly.GetAssembly(typeof(MyType)).FullName;
Type toActivate = Type.GetType("sometype, " + qulifiedName);
I've tried various ways, but hitting road blocks. Seems like I must know the namespace of the type. Is this true? Or am I missing something.
To recap, I have two things...
- The name of the type, ie MyClass
- Its executing assembl
Aucun commentaire:
Enregistrer un commentaire