C# cast reflected object to interface returns null
I am trying to do the following but I get yourObj=null
Assembly assembly = Assembly.LoadFrom(assemblyName);
System.Type type = assembly.GetType(typeName);
Object o = Activator.CreateInstance(type);
IYourType yourObj = (o as IYourType);
Aucun commentaire:
Enregistrer un commentaire