I am trying to instantiate a class at runtime. The classes I'm trying to create inherit from the base class ConfigMgrObj and are called ConfigMgr_xxxxxx for example. ConfigMgr_Collection . They all take a special object, which I call oController and the string as arguments.
This is the string that I use for this, where ClassToGet is the string that contains the class name, for example. ConfigMgr_Collection .
object oNewObject = System.Activator.CreateInstance(null, "StackOverflowNamespace." + ClassToGet, new object[] { oController, ClassToGet });
This throws a TypeLoadException. What about him?
source share