| name | ilspy-decompile |
| description | Decompile .NET assemblies using ilspycmd CLI tool. Invoke when you need to inspect compiled DLLs, compare original vs patched assemblies, or examine compiler-generated types (closures, iterators, state machines). |
ILSpy Command-Line Decompilation
Decompile .NET assemblies using ilspycmd to inspect compiled code structure, compare builds, and debug HybridPatch issues.
Prerequisites
ilspycmd is installed as a global .NET tool:
dotnet tool install --global ilspycmd
Common Commands
List all types in an assembly
ilspycmd -l MyLibrary.dll
Use this first to discover type names, especially compiler-generated ones.
Decompile a specific type
ilspycmd -t "Namespace.ClassName" MyLibrary.dll
For nested types, use / as separator: ilspycmd -t "Outer/Inner" MyLibrary.dll
Decompile entire assembly to stdout
ilspycmd MyLibrary.dll
Decompile to a project folder
ilspycmd MyLibrary.dll -p -o ./OutputDir
Decompile to a single file
ilspycmd MyLibrary.dll > Output.cs
Key Options
| Option | Description |
|---|
-o, --output <dir> | Set output directory or file path |
-p, --project | Export as C# Visual Studio project |
-t, --type <name> | Decompile only the specified type |