Why can't I retrieve the value for parameters of type out or ref using Type.InvokeMember?
A long title, but I wanted it to be specific. The title is really the question. Even though the method that InvokeMember is calling has an out parameter and is assigning a value to to that parameter I can't grab that value. Here is the code I was initially using: string parameter = ""; int result = Convert.ToInt32(typeof(Ability).InvokeMember(selectedMove, BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Static, null, null, new object[] { parameter })); I changed it this, which now makes it work as intended but I don't know why: object[] args = new object[1]; //necessary to