The method doesn't accept two parameters, it accepts one parameter that is an array. The compiler will perform a transformation such that a method call of two strings will be transformed into a call of a single array with two values. That transformation won't be done for you when using reflection. You'll need to explicitly create an array and put the two values in it:
method.Invoke(obj, new object[] { new[]{"param1", "param2"} });
Remember that Invoke
doesn't accept a single value of that one parameter either. It accepts an array of all parameters. Passing new string[] { "param1", "param2" }
to Invoke
is telling Invoke
that you have two parameters, each of which are strings. You need to wrap your one array parameter in another array so that Invoke
sees that you have one parameter that is itself an array.