Skip to content
Back to skills

Ilspy Decompile

ASecurity

Understand implementation details of .NET code by decompiling assemblies. Use when you want to see how a .NET API works internally, inspect NuGet package source, view framework implementation, or understand compiled .NET binaries.

  • 141 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 5, 2026
ai-agentsc#bashapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add NikiforovAll/claude-code-rules --skill ilspy-decompile --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ilspy Decompile?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ilspy Decompile
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nikiforovall-ilspy-decompile/badge)](https://www.skillsdirectory.com/skills/nikiforovall-ilspy-decompile)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ilspy-decompile
description: Understand implementation details of .NET code by decompiling assemblies. Use when you want to see how a .NET API works internally, inspect NuGet package source, view framework implementation, or understand compiled .NET binaries.
allowed-tools: Bash(dotnet dnx:*), Bash(ilspycmd:*)
---

# .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:
  - `dotnet 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

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

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

## Common .NET Assembly Locations

### NuGet packages

```bash
~/.nuget/packages/<package-name>/<version>/lib/<tfm>/
```

### .NET runtime libraries

```bash
dotnet --list-runtimes
```

### .NET SDK reference assemblies

```bash
dotnet --list-sdks
```

> Reference assemblies do not contain implementations.

### Project build output

```bash
./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 to find the target
4. Decompile the target

## Commands

### List types in an assembly

Use `-l` with an entity type to discover what's inside:

```bash
# List classes
ilspycmd -l c MyLibrary.dll

# List interfaces
ilspycmd -l i MyLibrary.dll

# List structs, delegates, enums
ilspycmd -l s MyLibrary.dll
ilspycmd -l d MyLibrary.dll
ilspycmd -l e MyLibrary.dll
```

### Basic decompilation

```bash
ilspycmd MyLibrary.dll
ilspycmd -o ./decompiled MyLibrary.dll
ilspycmd -p -o ./project MyLibrary.dll
```

### Targeted decompilation

```bash
# Decompile specific type
ilspycmd -t Namespace.ClassName MyLibrary.dll

# Specify C# language version (default: Latest)
ilspycmd -lv CSharp12_0 MyLibrary.dll
```

### View IL code

```bash
ilspycmd -il MyLibrary.dll
```

### Clean output

```bash
# Remove dead code and dead stores for cleaner results
ilspycmd --no-dead-code --no-dead-stores MyLibrary.dll
```

### Organized project output

```bash
# Decompile with nested directories matching namespaces
ilspycmd --nested-directories -p -o ./decompiled MyLibrary.dll
```

## References

- **references/diagrammer.md** — Generate interactive HTML diagrams from assemblies. Load when the user asks to visualize or explore type relationships.

## 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.

Files in this skill

  • SKILL.md3 KB
  • references/diagrammer.md2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…