How to read a method body with reflection

喜你入骨 提交于 2019-12-04 02:21:27

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!