How to insert CIL code to C#

前端 未结 5 2107
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-01 17:55

Is it possible to insert IL code to C# method?

5条回答
  •  半阙折子戏
    2021-02-01 18:19

    If inline IL (in the same spirit of inline assembly supported by C and C++ compilers) is what you're looking for, this can be achieved using post-compilation round-trip compiling.

    Mike Stall has once written a tool for that, as far as I know it's fairly mature:

    Other than that, you could use F# which supports Inline IL.

提交回复
热议问题