Free mag vol1 | Page 97

CHAPTER 1  THE PHILOSOPHY OF .NET  Note You can easily run ildasm.exe by opening a Developer Command Prompt, and type “ildasm” (without the quotes) followed by the Enter key. Chapter 2 will explain how to open this “special” command window, as well as other tools loaded from the command line. After you launch ildasm.exe, proceed to the File Open menu command and navigate to an assembly you would like to explore. By way of illustration, Figure 1-7 shows the Calc.exe assembly generated based on the Calc.cs file shown earlier in this chapter. ildasm.exe presents the structure of an assembly using a familiar tree-view format. Figure 1-7. ildasm.exe allows you to see the CIL code, manifest, and metadata within a .NET assembly Viewing CIL Code In addition to showing the namespaces, types, and members contained in a given assembly, ildasm.exe also allows you to view the CIL instructions for a given member. For example, if you were to double-click the Main() method of the Program class, a separate window would display the underlying CIL (see Figure 1-8). 29