mcpField
I
ilspy-decompile

ilspy-decompile

github.com/aarononthewebDevelopment1.2k615 installsUpdated today
Repository

About ilspy-decompile

A skill for inspecting compiled .NET assemblies with ILSpy. It guides developers through locating assemblies and decompiling whole files, selected types, or IL code.

Key features

  1. 01Decompile assemblies to stdout
  2. 02Write output to a folder
  3. 03Decompile selected types
  4. 04Inspect IL code
  5. 05Locate common assembly paths

Use cases

  1. 01Understanding compiled .NET library behavior
  2. 02Inspecting a specific type in an assembly
  3. 03Reviewing IL output
  4. 04Finding assemblies in NuGet or build directories

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aaronontheweb/dotnet-skills --skill ilspy-decompile

After installing, type/ilspy-decompilein Claude Code to confirm it loaded.

Details

From the project README

.NET Assembly Decompilation with ILSpy

Use this skill to understand how .NET code works internally by decompiling compiled assemblies.

Prerequisites

  • .NET SDK installed
  • ILSpy command-line tool available via one of the following:
    • dnx ilspycmd (if available in your SDK or runtime)
    • dotnet tool install --global ilspycmd

Both forms are shown below. Use the one that works in your environment.

Note: ILSpyCmd options may vary slightly by version.
Always verify supported flags with ilspycmd -h.

Quick start

# Decompile an assembly to stdout
ilspycmd MyLibrary.dll
# or
dnx ilspycmd MyLibrary.dll

# Decompile to an output folder
ilspycmd -o output-folder MyLibrary.dll

Common .NET Assembly Locations

NuGet packages
~/.nuget/packages/<package-name>/<version>/lib/<tfm>/
.NET runtime libraries
dotnet --list-runtimes
.NET SDK reference assemblies
dotnet --list-sdks

Reference assemblies do not contain implementations.

Project build output
./bin/Debug/net8.0/<AssemblyName>.dll
./bin/Release/net8.0/publish/<AssemblyName>.dll

Core workflow

  1. Identify what you want to understand
  2. Locate the assembly
  3. List types
  4. Decompile the target

Commands

Basic decompilation
ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll
Targeted decompilation
ilspycmd -t Namespace.ClassName MyLibrary.dll
ilspycmd -lv CSharp12_0 MyLibrary.dll
View IL code
ilspycmd -il MyLibrary.dll

Notes on modern .NET builds

  • ReadyToRun images may reduce readability
  • Trimmed or AOT builds may omit code
  • Prefer non-trimmed builds

Legal note

Decompiling assemblies may be subject to license restrictions.

Comments

Markdown supported