Inspecting Our Assembly with ILSpy

Knowing how things work will make you a better developer. One great thing about the use of an IL format in the .NET world is the capability to inspect compiled assemblies at any point in time without requiring the original source code.

Three commonly used tools to inspect assemblies include the .NET Framework IL disassembler tool (ildasm.exe), .NET Reflector from Red Gate, and ILSpy. For the time being, we’ll use ILSpy, which you can download for free from http://www.ilspy.net.

When you run the tool for the first time, it loads the ILSpy assembly as the assembly to inspect, including all of its dependencies, as shown in Figure 3.11.

FIGURE 3.11 ILSpy disassembling itself.

Because we’re not interested in the ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.