Creating method dynamically, and executing it

后端 未结 6 1209
轮回少年
轮回少年 2020-12-23 22:42

Background:

I want to define few static methods in C# , and generate IL code as byte array, from one of these methods, selected at runt

6条回答
  •  清歌不尽
    2020-12-23 23:43

    There is one hard way to get the "copy" method to work and will take a time.

    Take a look at ILSpy, this application is used to view and analyse existing code and is open-source. You could extract the code from the project which is used to analyse IL-ASM code and use it to copy the method.

提交回复
热议问题