开发者

How to generate IL source code with csc (C# compiler) or dmcs (mono C# compiler)?

开发者 https://www.devze.com 2023-04-01 01:26 出处:网络
gcc has an option of -s to generate assembly source code. Does csc (MS C# compiler) or dmcs (mono C# compiler) have equivalence? I mean do those compilers provide an option to generate IL source code

gcc has an option of -s to generate assembly source code. Does csc (MS C# compiler) or dmcs (mono C# compiler) have equivalence? I mean do those compilers provide an option to generate IL source code that can be read not the execution binary开发者_如何学运维?


It's very easy to get to the IL: just use ildasm. The /text option prints the result to the console, which you can divert to a file.


A C# compiler always generates IL (CIL in the case for .net), because thats the way .net works, but if you mean you want to precompile this in to machine code to speed up execution you can use ngen.exe (see HERE).

If you just want to see the generated IL you can use ILSpy.

0

精彩评论

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

关注公众号