views:

263

answers:

2

Does the Microsoft C# compiler (CSC.exe) have an option to output the Intermediate Language files? Kind of like the -S switch does in GCC?

+6  A: 

Your final executables and DLLs are stored in IL.

To see what I mean, download .NET Reflector, open one of your DLLs or executables, and switch the language to IL. It will also go through translating the IL into C# for you.

Will Eddins
DLLs aren't stored in IL. They are stored in Byte Code, right?
icemanind
There's no such thing as Byte Code with .net.
Joel Coehoorn
According to http://en.wikipedia.org/wiki/Common_Intermediate_Language, it's a little confusing. CIL and Bytecode are almost the same, either way its being JITed to native code, instead of compiled straight to native bytecode.
Will Eddins
Generally the binary code of virtual machines is called "bytecode", however, the ECMA CLI specification does not really use this term. It's called binary MSIL or binary IL.
DrJokepu
+8  A: 

You can use ildasm.exe to extract the IL from the assembly compiled by csc.exe.

GBegen
Tutorial on ILDASM http://msdn.microsoft.com/en-us/library/aa309387(VS.71).aspx
John K
Thanks for the link @jdk. I updated my answer to link directly there.
GBegen