How to read a method body with reflection
Asked Answered
D

2

12

Is it possible to find out anything about a Method body with reflection?

How?

Disunity answered 13/2, 2011 at 20:12 Comment(0)
C
18

You can use MethodInfo.GetMethodBody.

That provides you access to anything you want... if you're happy to work through the IL etc yourself.

It's possible that the Mono Cecil library will provide more help - I haven't used it myself.

Chump answered 13/2, 2011 at 20:13 Comment(1)
Thanks again dude. You're always hooking me up.Disunity
V
1

Talking of Mono.Cecil, it will give you access to the method body in a way that will look very familiar if you have ever peeked into a .NET assembly with ILDASM.

Vladikavkaz answered 13/2, 2011 at 21:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.