Top "Methodinfo" questions

How to pass a parameter as a reference with MethodInfo.Invoke

How can I pass a parameter as a reference with MethodInfo.Invoke? This is the method I want to call: …

c# reflection methodinfo
get methodinfo from a method reference C#

We can use a C# typeof keyword when we want to get Type instance for specified type. But what can …

c# .net reflection typeof methodinfo
Creating delegate from MethodInfo

I am currently running into an issue trying to create delegates from MethodInfo. My overall goal is to look through …

c# delegates attributes methodinfo
Getting a return value from a methodInfo.invoke

How do I get a return value (int) from a methodInfo.invoke? What makes it difficult for me is the …

invoke methodinfo
How to create a delegate from a MethodInfo when method signature cannot be known beforehand?

I need a method that takes a MethodInfo instance representing a non-generic static method with arbitrary signature and returns a …

c# .net reflection delegates methodinfo
How to test if MethodInfo.ReturnType is type of System.Void?

Using reflection to obtain a MethodInfo, I want to test if the type returned is typeof System.Void. Testing if …

c# reflection methodinfo
Can you get a Func<T> (or similar) from a MethodInfo object?

I realize that, generally speaking, there are performance implications of using reflection. (I myself am not a fan of reflection …

.net performance reflection methodinfo func
Invoke method by MethodInfo

I want to invoke methods with a certain attribute. So I'm cycling through all the assemblies and all methods to …

c# reflection invoke methodinfo
How to get MethodInfo of interface method, having implementing MethodInfo of class method?

I have a MethodInfo of an interface method and Type of a class that implements the interface. I want to …

c# .net reflection methodinfo
Use Reflection to call generic method on object instance with signature: SomeObject.SomeGenericInstanceMethod<T>(T argument)

How do I call SomeObject.SomeGenericInstanceMethod<T>(T arg) ? There are a few posts about calling generic methods, …

c# generics reflection methodinfo generic-method