Change “methodInfo” to “classInstance”, just like in the call with the null parameter array.
result = methodInfo.Invoke(classInstance, parametersArray);
More Related Contents:
- Reflection MethodInfo.Invoke() catch exceptions from inside the method
- Read the value of an attribute of a method
- Retrieving the calling method name from within a method [duplicate]
- How to check whether an object has certain method/property?
- Passing just a type as a parameter in C#
- Invoking methods with optional parameters through reflection
- Can I get parameter names/values procedurally from the currently executing function?
- How do I get the path of the assembly the code is in?
- Set object property using reflection
- How can I evaluate C# code dynamically?
- Dynamically replace the contents of a C# method?
- Invoke(Delegate)
- Assigning out/ref parameters in Moq
- Get all derived types of a type
- Using C# reflection to call a constructor
- How To Test if Type is Primitive
- Should C# methods that *can* be static be static? [closed]
- c# Creating an unknown generic type at runtime
- Discovering derived types using reflection
- Get all types implementing specific open generic type
- Dynamic table name in linq [duplicate]
- How can you loop over the properties of a class?
- How can I get the value of a session variable inside a static method?
- Get all properties which marked certain attribute
- Using GetProperties() with BindingFlags.DeclaredOnly in .NET Reflection
- C# params object[] strange behavior
- What’s wrong with calling Invoke, regardless of InvokeRequired?
- Implementations of interface through Reflection
- Get derived class type from a base’s class static method
- How to use Activator to create an instance of a generic Type and casting it back to that type?