I have a class that contains an empty constructor and one that takes an array of objects as a single parameter. Sort of...
public myClass(){ return; }
public myClass(object[] aObj){ return; }
This is the call to the CreateInstance () method that I use
object[] objectArray = new object[5];
Activator.CreateInstance(typeof(myClass), objectArray);
he throws System.MissingMethodExceptionwith an added message that reads "Constructor by type" myClass "not found"
A bit of research that I did always showed that the method is called
Activator.CreateInstance(typeof(myClass), arg1, arg2);
Where arg1 and arg2 are types (string, int, bool), and not common objects. How can I call this method only an array of objects as a list of its parameters?
Note. I tried to add another variable to the method signature. Sort of...
public myClass(object[] aObj, bool notUsed){ return; }
.
, , , . , ?