You need to get the Type
instance for AA
, then pass it to Activator.CreateInstance
.
Type myType = typeof(SomeTypeInProject).Assembly.GetType(typeName);
object instance = Activator.CreateInstance(myType);
3
solved How do I create an object from a string [duplicate]