I have a situation where I have to call an interface method using reflection, like this
object x = null; MethodInfo method = interfaceExists.GetMethod("ShutDown"); method.Invoke(x, new object[] { 4 })
As you can see, I am not creating an instance of the object! And, as I can assume, I get an exception
The non-static method requires a targeted
And the question is, can I call the interface method using reflection without creating an instance of the interface, and if YES, how can I do this?
jitm
source share