Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read a method body with reflection

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

How?

like image 1000
smartcaveman Avatar asked Feb 13 '11 20:02

smartcaveman


1 Answers

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.

like image 127
Jon Skeet Avatar answered Nov 08 '22 23:11

Jon Skeet