Skip to content
Back to skills

Csharp Decompile

ASecurity

Decompile .NET assemblies to inspect types, understand implementations, debug third-party libraries, and view IL code. Use when debugging NuGet dependency behavior, understanding compiled code, investigating runtime issues, or exploring unfamiliar assemblies.

  • 666 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added February 8, 2026
code-qualitygoc#bashdebugging

Works with

  • claude code

Security analysis

A100/100

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill csharp-decompile --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Csharp Decompile?

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

Security grade badge for Csharp Decompile
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-csharp-decompile/badge)](https://www.skillsdirectory.com/skills/majiayu000-csharp-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: csharp-decompile
description: Decompile .NET assemblies to inspect types, understand implementations, debug third-party libraries, and view IL code. Use when debugging NuGet dependency behavior, understanding compiled code, investigating runtime issues, or exploring unfamiliar assemblies.
---

# C# Decompilation with ilspycmd

Decompile .NET assemblies to C# source code or IL using `ilspycmd`.

## Setup

Ensure ilspycmd is installed:

```bash
ilspycmd --version || dotnet tool install --global ilspycmd
```

## Workflows

### List Types in an Assembly

Discover what's in an assembly before decompiling:

```bash
# List all types: classes, interfaces, structs, delegates, enums
ilspycmd -l cisde /path/to/assembly.dll
```

### Decompile to a Project

Generate a compilable C# project from an assembly:

```bash
ilspycmd --nested-directories -p -o /tmp/decompiled /path/to/assembly.dll
```

This creates a `.csproj` and source files organized by namespace.

*Important*: this lets Claude code bring its sophisticated code reading and exploration tools to bear.


### Decompile a Specific Type

Target a single type by its fully qualified name:

```bash
ilspycmd -t MyNamespace.MyClass /path/to/assembly.dll
```

The output goes to stdout. Use this to quickly inspect a type's implementation.

### View IL Code

For low-level analysis, view the intermediate language:

```bash
ilspycmd -il -t MyNamespace.MyClass /path/to/assembly.dll

# With sequence points (source line mappings)
ilspycmd --il-sequence-points -t MyNamespace.MyClass /path/to/assembly.dll
```

### Debug NuGet Dependencies

NuGet packages are at `~/.nuget/packages/<package-name>/<version>/lib/<tfm>/`. To inspect:

```bash
# Find the DLL
find ~/.nuget/packages/sixlabors.imagesharp -name "*.dll" | grep -v ref

# List types
ilspycmd -l cisde ~/.nuget/packages/sixlabors.imagesharp/3.1.11/lib/net6.0/SixLabors.ImageSharp.dll

# Decompile a specific type
ilspycmd -t "SixLabors.ImageSharp.Numerics" ~/.nuget/packages/sixlabors.imagesharp/3.1.11/lib/net6.0/SixLabors.ImageSharp.dll
```

### Generate Type Diagrams

Create an interactive HTML visualization of type relationships:

```bash
ilspycmd --generate-diagrammer -o /tmp/diagrammer /path/to/assembly.dll

# With filtering
ilspycmd --generate-diagrammer -o /tmp/diagrammer \
  --generate-diagrammer-include "MyNamespace\\..*" \
  --generate-diagrammer-exclude "MyNamespace\\.Internal\\..*" \
  /path/to/assembly.dll
```

These are mostly useful for the user. Let the user know that they're available.

## Tips

- Add `-r /path/to/deps` when the assembly has dependencies that aren't automatically resolved
- Use `--no-dead-code` and `--no-dead-stores` for cleaner output
- For tight loops or scripts, add `--disable-updatecheck`
- The `-lv Latest` flag is default; use `-lv CSharp9_0` etc for older language features

## Fixes

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.