Free & open source.NET assembly browser & debugger

dnSpy – Assembly Inspection and Code Debugging Tool

dnSpy provides a practical environment for examining .NET assemblies, exploring decompiled source code, and debugging applications. It helps developers inspect program structures, analyze compiled code, and work with assemblies through an integrated interface.

3 in 1Decompiler · Debugger · Editor
x86 / x64dnSpy-x86.exe & dnSpy.exe
C# · VB · ILOutput languages
dnSpy main window with the Assembly Explorer tree and decompiled C# code of a StockService class
Breakpoint hitReserve(string, int)
Edit Method (C#)Compiled · 0 errors
Assembly Explorer listing references, namespaces and resources of a .NET assembly with its assembly attributes
what is dnspy

What Is dnSpy?

dnSpy is an open-source debugger and assembly editor for programs written on the .NET platform. Every .NET executable or class library carries Intermediate Language (IL) and rich metadata about its types, methods and fields. dnSpy reads that data, presents it as a browsable tree, and reconstructs high-level source code so you can follow the logic of an application that you only have in compiled form.

What sets dnSpy apart from a plain decompiler is that the reading, the debugging and the editing happen in the same window. You can find a method, put a breakpoint on a line of decompiled C#, start the program, inspect the values that arrive, rewrite the method body, compile it in place and save a new copy of the assembly, all without a Visual Studio solution or the original source files.

The project was started by the developer known as 0xd4d, who also wrote the de4dot deobfuscator and the dnlib metadata library that dnSpy relies on. The decompiler engine comes from ILSpy. The original GitHub repository was archived in late 2020, and active development has continued in the community fork dnSpyEx.

Type
Debugger + assembly editor
Platform
Windows (WPF desktop app)
Licence
GNU GPL v3
Targets
.NET Framework, .NET, Unity (Mono)
key features

Key Features of dnSpy

The feature set covers the full loop of reverse engineering a managed binary: read it, run it under a debugger, change it, and verify the change.

Source-free debugger

Debug .NET Framework, .NET Core / .NET 5+ and Unity Mono processes directly on decompiled code. No PDB files and no original project are required.

  • Breakpoints with conditions, hit counts and filters, plus tracepoints
  • Locals, Autos, Watch, Call Stack, Threads, Modules and Memory windows
  • Attach to a running process or launch with arguments

C#, VB & IL output

Switch the view between C#, Visual Basic and raw IL for any type or member. The output stays clickable, so every type name leads to its definition.

Edit in C# or VB

Rewrite a method or an entire class in C# or Visual Basic, compile it with the built-in Roslyn compiler and merge the result back into the assembly.

IL instruction editor

When a high-level edit will not compile, change single IL instructions, locals and exception handlers instead.

Hex editor & PE view

Inspect DOS, PE and section headers, metadata streams and tables, and jump from a tree node to its exact bytes in the hex editor. Changes made in the hex view can be saved like any other edit.

Search & analyzer

Search every loaded assembly for types, members, string literals or numeric constants, then use the Analyzer to see where a method is used, what it calls and which types derive from a class.

BAML to XAML

Decompiles compiled WPF resources back into readable XAML so window layouts and bindings can be studied.

Module dumping

Save modules loaded in a debugged process to disk, including dynamic and in-memory modules that never existed as files.

Export to project

Write a whole assembly out as a C# or VB project with source files, so it can be opened and studied in an IDE.

why choose dnspy

Why Choose dnSpy?

Plenty of tools can show decompiled .NET code. Fewer let you act on what you see without leaving the window.

Debugging and decompiling share one view

The line you are reading is the line you can break on. You do not have to export a project, rebuild it and hope the generated PDB lines up with the binary that is actually running.

Fixes are saved back to the binary

Patch a hard-coded path, a broken null check or a timeout in a third-party library you cannot rebuild, then save the module and test the result straight away.

Portable and free

dnSpy runs from an extracted folder. It needs no installer and no licence key, and its GPLv3 source code can be read and built by anyone.

Unity game code is in reach

For Unity titles built with the Mono scripting backend, dnSpy can read Assembly-CSharp.dll and, with the debugging-enabled Mono builds the project published, attach its debugger to the running game.

A familiar, Visual Studio-like layout

Tabs, tab groups, docked tool windows, keyboard shortcuts such as F9 for breakpoints and F12 for go-to-definition, and light, blue and dark themes keep the learning curve short for .NET developers.

how it works

How Does dnSpy Work?

Behind the interface, dnSpy chains a metadata reader, a decompiler, a compiler and a debugger engine together.

Read the metadata

dnlib parses the PE file, the metadata tables, the string heaps and the IL bodies of every method, even when names are mangled by an obfuscator.

Decompile the IL

The ILSpy-based engine rebuilds control flow, expressions and language features such as lambdas, async methods and LINQ into C# or Visual Basic.

Map code to IL offsets

Each decompiled statement keeps a link to its IL range. That mapping is what lets a breakpoint on a C# line land on the correct instruction.

Debug, edit, save

The debugger engine controls the process, Roslyn compiles your edits, and dnlib writes a new assembly with the modified bodies and metadata.

Three panels showing raw bytes from a DLL, the matching IL instructions and the resulting readable C# code
Windows Explorer showing an extracted dnSpy folder with dnSpy.exe, dnSpy-x86.exe, dnSpy.Console.exe and the bin directory
install on windows

How to Download and Install dnSpy on Windows

dnSpy is a portable application, so “installing” it means extracting a folder. The steps below keep the setup clean and avoid the most common first-launch errors.

  1. Get the files from GitHub

    Use the download button on this page for the source archive, or open the releases page of the original repository or of dnSpyEx for prebuilt binaries such as dnSpy-net-win64.zip.

  2. Unblock the zip

    Right-click the downloaded archive, choose Properties and tick Unblock if Windows shows it. This stops “file came from another computer” restrictions on the extracted DLLs.

  3. Extract to a folder you own

    A path such as C:\Tools\dnSpy works well. Avoid Program Files, which needs admin rights to write settings and patched files.

  4. Start the right executable

    Run dnSpy.exe for 64-bit work. Use dnSpy-x86.exe when you need to debug a 32-bit process.

  5. Open an assembly

    Drag a .dll or .exe onto the window, or use File › Open. Your list of opened files is restored on the next launch.

system requirements

dnSpy System Requirements

dnSpy is light on hardware. The deciding factor is which package you choose and which runtime it depends on.

ComponentMinimumRecommended
Operating systemWindows 7 SP1 or laterWindows 10 or 11, 64-bit
Runtime (.NET Framework package).NET Framework 4.7.2.NET Framework 4.8
Runtime (self-contained packages)None, bundled in the zipNone, bundled in the zip
Processorx86 or x64 CPUModern multi-core x64 CPU
Memory2 GB RAM8 GB RAM or more for large assemblies
Disk spaceAbout 100 MB extractedExtra space for exported projects and dumps
Display1280 × 7201920 × 1080 or higher

dnSpy-net-win64.zip

Self-contained 64-bit build. The best default for most users on a 64-bit PC.

dnSpy-net-win32.zip

Self-contained 32-bit build, for 32-bit Windows or for debugging x86 processes.

dnSpy-netframework.zip

Smaller download that runs on the installed .NET Framework and includes both 64-bit and x86 launchers.

benefits

Benefits of Using dnSpy

Who gets the most out of dnSpy, and in which day-to-day situations it saves real time.

Diagnose production-only bugs

Attach to the exact build that fails on a test server and watch the real values, instead of guessing from logs.

Recover lost source

When the repository of an old internal tool is gone, decompiling and exporting a project is often the fastest way back.

Review what a binary really does

Security teams use dnSpy to read suspicious .NET samples and audit third-party dependencies before trusting them.

Understand undocumented APIs

See how a library validates input, which exceptions it throws and what it calls internally, without waiting for documentation.

Build mods with confidence

Unity modders read game classes to find the right hooks for frameworks such as BepInEx or Harmony patches.

Learn how the compiler works

Comparing C# with its IL shows what async, LINQ, closures and pattern matching turn into after compilation.

dnSpy Edit Method (C#) dialog with a modified Reserve method and a successful compilation in the error list
// Typical edit loop in dnSpy
1. Right-click method  ›  Edit Method (C#)…
2. Change the body, press Compile
3. File  ›  Save Module…
4. Reload the saved file and re-test
decompile & edit

How to Decompile and Edit .NET Assemblies with dnSpy

The workflow below assumes you are working with an assembly you own or are authorised to modify. Always keep an untouched copy of the original file before saving changes.

Open and locate the code

Load the assembly, expand its namespaces in the Assembly Explorer, or press Ctrl+Shift+K to search for a type, method or string.

Understand the call path

Use Analyze on the method to list its callers and callees before you change anything, so you know what else depends on it.

Edit in C# or switch to IL

Choose Edit Method (C#) for most changes. If the decompiled class does not recompile cleanly, use Edit IL Instructions for small, precise changes.

Save the module

Use File › Save Module. Keep the default options unless you need to preserve metadata tokens or the original heap layout.

interface

dnSpy Screenshots and User Interface

The interface is built from docked tool windows around a tabbed code editor. These illustrations show the main views you will work in.

comparison

dnSpy vs Other .NET Decompilers and Debuggers

Each tool has a different focus. This overview compares the capabilities that matter most when choosing one.

CapabilitydnSpy / dnSpyExILSpyJetBrains dotPeek.NET Reflector
PriceFree, GPLv3Free, MITFree (closed source)Paid licence
Decompile to C#YesYesYesYes
Built-in debugger on decompiled codeYes, standaloneNoSymbol server for VS / RiderVisual Studio add-in
Edit methods in C# and saveYesNoNoNot built in
IL editingYesView onlyView onlyVia add-ins
Hex editorYesNoNoNo
Runs on Linux / macOSWindows only (Wine possible)Cross-platform frontendsWindows onlyWindows only
Development statusOriginal archived; dnSpyEx activeActively maintainedActively maintainedMaintained by Redgate
safety

Is dnSpy Safe to Download and Use?

The genuine dnSpy is open-source software whose code anyone can audit, and it does not contain malware. The risk lies in where a copy comes from. Because the tool is popular with developers and game modders, fake installers and look-alike download sites have been used to spread malicious builds. Security researchers reported one such campaign in 2022.

Some antivirus engines also flag genuine copies, because a debugger that can patch binaries and attach to processes behaves a lot like tools that attackers use. A detection on its own does not prove a file is infected, and a clean scan does not prove a file is genuine. Provenance matters more.

  • Download only from the original github.com/dnSpy/dnSpy repository or the github.com/dnSpyEx/dnSpy fork.
  • Ignore “dnSpy setup.exe” installers, cracked “pro” editions and file-hosting mirrors. dnSpy has never shipped as an installer.
  • Record the SHA-256 hash of the zip with Get-FileHash and compare it with a copy you trust.
  • Analyse unknown or suspicious assemblies inside a virtual machine, not on your main workstation.
PowerShell window computing the SHA-256 hash of the dnSpy zip next to a pre-launch safety checklist
troubleshooting

Common dnSpy Issues and Solutions

Most problems come from runtime versions, process bitness or file permissions. Here are the fixes that resolve them.

dnSpy closes immediately or will not start

The .NET Framework package needs .NET Framework 4.7.2 or newer. Install 4.8, or switch to a self-contained net-win64 package that brings its own runtime. Also make sure the zip was unblocked before extraction.

“Cannot attach to process”

The bitness does not match. A 32-bit target must be debugged with dnSpy-x86.exe. If the target runs elevated, start dnSpy as administrator too.

Breakpoints are skipped

The JIT optimised the code. Turn on the JIT-optimization suppression settings under Debug › Options › Debugger and start the program from dnSpy instead of attaching after launch, or add a DebuggableAttribute through the assembly editor.

Edited method will not compile

Decompiled code is not always valid C#: compiler-generated names and missing references cause errors. Use Edit Method rather than Edit Class, add missing references, or make the change with Edit IL Instructions.

“Access denied” when saving the module

The file is in use or sits in a protected folder. Close the program that loaded it, save to a different path, or copy the target into a writable working folder first.

Code shows only odd names or empty methods

The assembly is obfuscated, or it is an IL2CPP or Native AOT build with no IL inside. A deobfuscator such as de4dot helps with some obfuscators. Native builds need native tools instead.

faq

Frequently Asked Questions (FAQs)

Is dnSpy free?

Yes. dnSpy is free and open-source under the GNU General Public License v3. There is no paid edition, so anything sold as “dnSpy Pro” is not genuine.

Is dnSpy still maintained?

The original repository was archived in late 2020, with version 6.1.8 as its last release. Development continues in the community fork dnSpyEx, which adds support for newer .NET versions and fixes bugs.

Can dnSpy decompile any .exe file?

Only files that contain .NET IL. Native C or C++ programs, Unity IL2CPP games and .NET Native AOT executables contain machine code instead, which dnSpy cannot turn into C#.

Is there an official dnSpy for Android, Linux or macOS?

No. dnSpy is a Windows WPF application. On Linux it can be run through Wine with limitations, and there is no Android or macOS build. You can still extract .NET assemblies from an APK and open them with dnSpy on a Windows PC.

Is it legal to use dnSpy?

Using the tool itself is legal. Whether a specific use is allowed depends on the software you analyse, its licence and the laws where you live. Debugging your own code and lawful interoperability or security research are common legitimate uses. Bypassing licensing or copying protected code is not.

What is the difference between dnSpy.exe and dnSpy-x86.exe?

dnSpy.exe runs as a 64-bit process and debugs 64-bit targets. dnSpy-x86.exe runs as 32-bit and is needed to debug 32-bit processes. Both decompile any assembly regardless of its bitness.

Does dnSpy need to be installed?

No. Extract the zip and run the executable. Settings are stored in your user profile by default, so you can move or delete the folder without leaving an uninstaller behind.

Start exploring .NET assemblies with dnSpy

Get the dnSpy source archive from the original GitHub repository, then check the releases page if you prefer a prebuilt package for your system.

Download dnSpy (master.zip)
Source · github.com/dnSpy/dnSpy
Format · zip archive
Licence · GPLv3, free
Platform · Windows