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

gcc has the option of -s generating assembly source code. Does csc (MS C # compiler) or dmcs (mono C # compiler) have equivalence? I mean, do these compilers provide the ability to generate IL source code that can be read by non-executable binary?

+4
source share
2 answers

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

+7
source

The AC # compiler always generates IL ( CIL in the case of .net), since it works .net, but if you mean you want to compile it into 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 .

+2
source

Source: https://habr.com/ru/post/1369506/


All Articles