Contents
ILSpy turns a program built on .NET (a DLL or EXE) back into C# code that you can read on screen. This review covers one use: opening a small app you built yourself, seeing that a secret you embedded is plainly readable, and learning why secrets must stay out of the program you ship.
This review is for people who build apps or libraries on .NET and want to see, before release, what someone can read from the build output. After reading it, you can do the following:
- Tell the ILSpy desktop app, the command-line tool (ilspycmd), and the VS Code extension apart
- Open a .NET app you built and read its code and strings
- Confirm that a dummy secret is readable, and rethink how you keep secrets
What ILSpy is for
ILSpy is a browser and decompiler for .NET assemblies (the packaged files .NET programs run from). According to the official README, it can:
- Turn an assembly back into C# (or show it as IL, the intermediate language)
- Write out a whole project at once
- Search for types, methods, and properties, and follow links between them
- Explore assembly metadata (the tables that describe types and references)
- Open assemblies from disk, from a NuGet feed, and from a running process (the v11.0 release notes say the running-process feature works on all platforms; opening from the GAC is Windows-only)
- Add features with plugins
Getting it and what it runs on
ILSpy uses the MIT license. The same name covers several entry points for different situations. As of 2026-10-28, the latest version is v11.2.
| Entry point | Runs on | Notes |
|---|---|---|
| Desktop app | Download files exist for Windows (x64, arm64), Linux (x64), and macOS (arm64) | Since v11.0, only the rebuilt Avalonia app is shipped |
| ilspycmd | Windows, Linux, macOS | A command-line tool installed with dotnet tool |
| VS Code extension | Where VS Code and the .NET runtime run | The wiki’s comparison table says it lacks resource and metadata analysis, PDB generation, and plugins |
| Visual Studio extension | Visual Studio 2022 / 2026 | An official extension. Visual Studio itself also ships decompilation for F12 by default |
Here is what the official sources say about the desktop app:
- According to the v11.0 release notes, ILSpy moved from WPF to Avalonia. That brought Linux and macOS support. The WPF app was removed entirely, so from v11.0 on there is only the Avalonia app. The WPF app was Windows-only.
- The Windows zip files come in two kinds: one that needs a separate .NET runtime (x64 and arm64), and one that bundles the runtime (x64). The Linux and macOS downloads bundle the runtime.
- The Windows installer (MSI) installs per user, into
%LocalAppData%\Programs\ILSpy. If you unpack a zip, no OS needs administrator rights. For Linux there are also.deband.rpmpackages, which install to/opt/ilspyand need root. - The README says a Microsoft Store version exists (release versions only).
- The v11.2 downloads include no macOS Intel build and no Linux arm64 build. On those systems, build it yourself with the steps in the README.
Installing ilspycmd needs .NET SDK 10.0.100 or later. On Windows x64 and Linux x64, you get a Native AOT build that needs no .NET runtime. Elsewhere you get a build that runs on the .NET 10 runtime.
Network connections
Here is what we confirmed by reading the source code:
- Desktop update check. It is on by default. At startup, in the background, the app fetches
https://icsharpcode.github.io/ILSpy/updates.xmlto see whether a newer version exists. It skips the check if the last successful one was less than 7 days ago. A failure shows no error. You can also run it by hand from “Help → Check for Updates”. To turn it off, clear “Automatically check for updates every week” on the About page. - Open from NuGet feed. The app connects to a NuGet feed only when you use “Open from NuGet feed”. The default feed is
https://api.nuget.org/v3/index.json. - ilspycmd update check. It is on by default. On every run, it fetches
https://api.nuget.org/v3-flatcontainer/ilspycmd/index.jsonand compares versions. If your copy is old, it prints a request to update on standard error. Add--disable-updatecheckto turn it off. - VS Code extension. On first start, it downloads a .NET runtime automatically. The runtime goes into a VS Code folder and leaves the system alone. Only on Linux might it also install packages the runtime depends on.
The Privacy section of the README says ILSpy collects no personally identifiable information, sends no user files to third-party services, and uses no telemetry service. The update check code we read does not send the files you open either. We did not read all of ILSpy’s code, though.
Try it safely: read a dummy secret in your own app
Use a small app you build yourself, not someone else’s software. The string you embed here is a dummy, not a real secret.
-
Install the .NET SDK, then create a console app in a working folder.
dotnet new console -n demo -
Replace
demo/Program.cswith the following. It writes a dummy API key directly in the code.var apiKey = "DUMMY-API-KEY-0000-NOT-REAL"; Console.WriteLine($"key length: {apiKey.Length}"); -
Run a release build in the
demofolder.dotnet build -c ReleaseThe resulting
bin/Release/<framework name>/demo.dllis the file you would ship. On my machine (.NET SDK 10.0.402), it wasbin/Release/net10.0/demo.dll. A byte search confirmed that the dummy string sits inside this DLL as plain UTF-16. Reading it takes no special skill. -
From the releases page, download the zip that fits your system, unpack it, and start ILSpy. If you pick the Windows zip that needs a separate runtime, install the .NET 10 runtime first. If you would rather not, pick the zip with
selfcontainedin the name. -
Open
demo.dll(use the File menu). -
Select
Programin the left tree. The decompiled C# appears on the right, and the dummy string you put inapiKeyshould be readable as it is. -
You can also search with a filter, such as
c:DUMMY. One of the search filters is Constant. The official docs do not say what range of values Constant covers, though. If nothing turns up, openProgramand read it directly. -
Then rethink how you keep secrets. Don’t write keys, tokens, or passwords in code or in config files that ship with the app. Keep them in environment variables, a secrets manager, or server-side logic. If a build you already shipped contained a real secret, treat it as leaked and issue a new key.
You can also inspect things in bulk from the command line.
-
Install ilspycmd.
dotnet tool install --global ilspycmd -
Run it on a DLL. Without an output folder, the decompiled C# goes to standard output.
ilspycmd --disable-updatecheck demo.dll -
Searching that output lets you check, on every build, that no secrets remain. It also pairs well with gitleaks, which scans source and repository history for the same problem.
Common uses
These are the main ilspycmd options. ilspycmd --help lists all of them.
| Option | What it does |
|---|---|
-o, --outputdir |
Output folder. Without it, output goes to standard output |
-p, --project |
Write a project that can be compiled. Needs -o |
-t, --type |
Decompile only the type with this fully qualified name |
-m, --member |
Decompile a single member |
-il, --ilcode |
Show IL instead of C# |
-l, --list |
List classes, interfaces, structs, delegates, or enums |
--list-resources |
List embedded resources |
--resource |
Extract one resource. A .baml resource is turned back into XAML |
-genpdb, --generate-pdb |
Generate a PDB |
-r, --referencepath |
Folder that holds the DLLs this one depends on |
--disable-updatecheck |
Skip the update check |
In the desktop app, you follow links to types and their references, and you can move between base types and derived types.
How ILSpy differs from Ghidra, x64dbg, and jadx
| ILSpy | Ghidra | x64dbg | jadx | |
|---|---|---|---|---|
| Main target | .NET assemblies | Native executables in general | Native Windows executables | Dex files of Android apps |
| Result | Decompiled C# and IL | Disassembly and decompiled output | Instructions and memory while the program runs | Decompiled Java |
| Runs the program? | Reads the file. The README’s feature list has no debugger | Mostly reads | Runs the program and pauses it | Reads the file |
A .NET program ships as intermediate language (IL) plus metadata. That is why ILSpy’s output stays close to the original C#. A native executable does not decompile that cleanly.
To choose by goal: use ILSpy to read the contents of a .NET build, Ghidra for native executables, x64dbg to watch behavior while a program runs, and jadx for Android apps.
Cautions
- Only read apps that you built, or training material that clearly allows analysis. Someone else’s software may forbid analysis in its terms of use or license agreement. ILSpy is not a tool for removing protection or getting around licenses.
- When you open an assembly of unknown origin, use an environment separate from your everyday PC. The v11.0 release notes list fixes that guard against crafted files at load time. Use a recent version.
- A plugin is a program that runs inside ILSpy. Check where it comes from before you install it.
- Decompiled code can contain errors and misreadings. For important decisions, also check the IL view and the real behavior.
- Not being able to read a secret in ILSpy does not make it safe. Obfuscation only makes code harder to read. It does not protect a secret. The basic rule is to keep secrets out of the program you ship.
- Get ILSpy from the official GitHub releases page or from the marketplaces listed in the README.
Read next
Sources
- Official repository README (features, frontends, build, privacy statement)github.com/icsharpcode/ILSpy/blob/master/README.md
- License (MIT)github.com/icsharpcode/ILSpy/blob/master/LICENSE
- Release v11.0 (WPF frontend removed, Avalonia port)github.com/icsharpcode/ILSpy/releases/tag/v11.0
- Release v11.2 (latest version and assets)github.com/icsharpcode/ILSpy/releases/tag/v11.2
- Source: publish script that builds the release bundles (publish.ps1)github.com/icsharpcode/ILSpy/blob/master/publish.ps1
- Source: installer definition (setup.cs, per-user install)github.com/icsharpcode/ILSpy/blob/master/ILSpy.Installer/setup.cs
- Source: update check code (UpdateService.cs)github.com/icsharpcode/ILSpy/blob/master/ILSpy/Updates/UpdateService.cs
- Source: update check setting defaults (UpdateSettings.cs)github.com/icsharpcode/ILSpy/blob/master/ILSpy/Updates/UpdateSettings.cs
- Source: update check checkbox on the About page (AboutCommand.cs)github.com/icsharpcode/ILSpy/blob/master/ILSpy/Commands/AboutCommand.cs
- Source: NuGet feed defaults (NuGetFeedSettings.cs)github.com/icsharpcode/ILSpy/blob/master/ILSpy/NuGetFeeds/NuGetFeedSettings.cs
- ilspycmd README (install and options)github.com/icsharpcode/ILSpy/blob/master/ICSharpCode.ILSpyCmd/README.md
- Source: ilspycmd update check (DotNetToolUpdateChecker.cs)github.com/icsharpcode/ILSpy/blob/master/ICSharpCode.ILSpyCmd/DotNetToolUpdateChecker.cs
- VS Code extension READMEgithub.com/icsharpcode/ilspy-vscode/blob/master/README.md
- VS Code extension installation (wiki)github.com/icsharpcode/ilspy-vscode/wiki/Installation
- Feature comparison of the VS Code extension and the desktop app (wiki)github.com/icsharpcode/ilspy-vscode/wiki/Feature-Comparison
- Linux rpm package definition (ilspy.spec)github.com/icsharpcode/ILSpy/blob/master/BuildTools/packaging/linux/rpm/ilspy.spec
- Search options (wiki)github.com/icsharpcode/ILSpy/wiki/Search-Options
Checked on 2026-10-28
Similar tools
Ghidra
Impact Local onlyA free, open-source software reverse engineering suite from the NSA. It disassembles and decompiles compiled programs so you can read what they do.
- Purpose
- Learning
- Type
- Desktop app
- Difficulty
- Advanced
- License
- PermissiveApache-2.0
- Category
- Reverse engineering / Learning and practice labs
Gitleaks
Impact Local onlyA command-line tool that finds passwords, API keys, and tokens that have slipped into Git repositories and files.
- Purpose
- Defense
- Type
- Command line
- Difficulty
- Beginner
- License
- PermissiveMIT
- Category
- Vulnerability scanning
jadx
Impact Local onlyA decompiler that turns Android APK and DEX files back into Java source you can read. It comes as a GUI for reading and a command-line tool for bulk output.
- Purpose
- Audit
- Type
- Desktop app
- Difficulty
- Intermediate
- License
- PermissiveApache-2.0
- Category
- Reverse engineering / Mobile security
x64dbg
Impact Reaches othersAn open-source debugger for Windows. It runs an executable that has no source code, pauses it, and lets you inspect instructions, registers, and memory.
- Purpose
- Learning
- Type
- Desktop app
- Difficulty
- Advanced
- License
- CopyleftGPL-3.0
- Category
- Reverse engineering / Malware analysis