Inspecting .NET Assemblies with ILDASM

Posted: (EET/GMT+2)

 

The Microsoft .NET Framework includes the Intermediate Language Disassembler (ILDASM) tool, a GUI utility for examining the contents of managed assemblies. It allows developers to inspect metadata, manifests, resources, and Microsoft Intermediate Language (MSIL) generated by the .NET compatible compiler (think C#).

ILDASM is useful for understanding how assemblies are organized and for learning how different .NET language features are translated into IL. You can use the tool for both executables (.exe) and libraries (.dll).

ildasm MyApplication.exe
ildasm MyLibrary.dll

The tool displays namespaces, classes, methods, properties, and assembly references in a tree view. Individual methods can also be viewed as MSIL instructions. For instance:

.method public hidebysig static void Main() cil managed
{
    // MSIL instructions...
}

Because all .NET languages compile to the same intermediate language, ILDASM provides an excellent way to explore assemblies created with C#, Visual Basic .NET, and other .NET languages.