简体   繁体   中英

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

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.

AC# 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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM