Without knowing what class ci
came from, it is hard to tell what might be wrong, but ConstructorInfo.invoke
returns type Object
, but you can cast it to whatever the type actually is, like:
var tob = (MyClass)(ci.Invoke(new object[]{10,"hello"}));
This is assuming that whatever class ci
is from actually has a public method named A