Don't ask me why but I need to do the following:
string ClassName = "SomeClassName";
object o = MagicallyCreateInstance("SomeClassName");
I want to know how many ways there are to do this is and which approach to use in which scenario.
Examples:
Activator.CreateInstance
Assembly.GetExecutingAssembly.CreateInstance("")
- Any other suggestions would be appreciated
This question is not meant to be an open ended discussion because I am sure there are only so many ways this can be achieved.
question from:https://stackoverflow.com/questions/9854900/instantiate-a-class-from-its-textual-name