I need to call the Non default constructor when using assembly.CreateInstance. as?
Activator.CreateInstance is a much friendlier API than Assembly.CreateInstance for use in such things:
Activator.CreateInstance
Assembly.CreateInstance
var type = Type.GetType("MyNamespace.MyClass, MyAssembly"); Activator.CreateInstance(type, constructorParam1, constructorParam2);
Try this overload:
public Object CreateInstance ( string typeName, bool ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes )
It has an args parameter.
args