[Previous] [Contents] [Next]

Spelunking with ILDASM

As you read in Chapter 2, when you create an EXE or a DLL by using a .NET compiler, the file is not your ordinary executable. Instead, it comprises a manifest, which lists the types and classes included in the file, and MSIL (Microsoft intermediate language) opcodesthat are later compiled and executed by your installation application or the .NET runtime using a just-in-time compiler (JITter).

One huge advantage of this is that the generated MSIL looks like assembly language and can be used as an incredible teaching tool to illustrate what the compiler has done with our code. For this reason, many times in this book I'll "drop down" to the C# compiler's MSIL output to illustrate how something works under the covers or to explain why you should use a particular feature of the language in a specific manner. To see the MSIL output by the .NET compilers, Microsoft has included a disassembler named the Microsoft .NET Framework IL Disassembler (ILDASM) to enable you to open a .NET executable file (EXE or DLL) and peruse its namespaces, classes, types, and code. We'll begin getting comfortable with ILDASM in the next section.

[Previous] [Contents] [Next]