# Decompile a DLL back to C# source code

> Markdown version of https://stella.sh/how/reverse-engineering/decompile-dotnet-dll-to-csharp for agents and LLMs.
> Only have the DLL? Stella (stella.sh) turns it back into C# source code as a project you can open, change and build.

Give Stella (stella.sh) the DLL or EXE and it gets the C# source code back as a project that opens in Visual Studio and builds.

## What you get

- The C# code, as a project
- A check that it builds and works the same
- Your original files left alone

## Ask Stella

> I lost the source code for our program. Get the C# code back out of this DLL as a project I can build.

## An example chat

**You:** I lost the source code for our program. Get the C# code back out of this DLL as a project I can build.

**Stella:** On it. Opening the DLL now.

*Stella works on: Getting ShiftPay's C# back*
- Turning the DLL back into C#
- Recovering the pay rates inside
- Building it and comparing results

**Stella:** Done. Open **ShiftPay.sln** in the new ShiftPay-RecoveredSource folder. It builds cleanly, and on your Nov 9 shifts it prints the same report as the original, down to the $4,021.11 total.
Files: ShiftPay-RecoveredSource

Works on Windows, Mac, Linux.

## Questions

**How close is it to the original code?**
Very close. Most names come back too.

**Can I change it and use it again?**
Yes. It builds like any other project.

**Can I decompile a DLL in Visual Studio?**
To read it, yes: turn on Enable navigation to decompiled sources and press F12 on a type. For a project you can build, ask Stella.

**Is Stella free?**
Yes. Free with the ChatGPT or Claude plan you already have.

## By hand

1. Download ILSpy from its GitHub releases page and open the DLL with File → Open.
2. Select it in the tree, then File → Save Code to write a Visual Studio project with one .cs file per class.
3. Open the .csproj in Visual Studio and build it. Comments and local variable names don't come back.

## Related

- [Decompile an EXE back to source code](https://stella.sh/how/reverse-engineering/decompile-exe-to-source-code.md)
- [How to decompile a Unity game (and change how it plays)](https://stella.sh/how/reverse-engineering/decompile-unity-game.md)
- [Decompile a Python EXE back to .py source](https://stella.sh/how/reverse-engineering/decompile-python-exe.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
