开发者

Is there a way to “reflect” ILGenerator.Emit commands from IL code?

开发者 https://www.devze.com 2023-04-11 00:20 出处:网络
I am trying to dynamically emit some generic method that I’ve prototyped in C#. Based on IL code presented in ILDASM, is there a way to generate adequate sequence of ILGenerator.Emit() commands that

I am trying to dynamically emit some generic method that I’ve prototyped in C#. Based on IL code presented in ILDASM, is there a way to generate adequate sequence of ILGenerator.Emit() commands that finally would com开发者_Python百科pile into the same IL?

Thanks for your help!


FWIW: I've tended to do this by hand, but I've seen a .NET Reflector plugin which sounds like it'd do what you want: ReflectionEmitLanguage. I've been curious as to what that'd do, but I haven't actually tried it.


There is an Add-In for the popular .NET decompiler "Reflector": Look for ReflectionEmitLanguage on Codeplex

0

精彩评论

暂无评论...
验证码 换一张
取 消