views:

17881

answers:

4

I wrote a C# application for a client a couple of years ago, but I no longer have the source code. All I have is the EXE that I deployed on the client's PC. Is there a way I can generate C# source code from the EXE?

+42  A: 

Reflector and it's add-in FileDisassembler.

Reflector will allow to see the source code. FileDisassembler will allow you to convert it into a VS solution.

Geoffrey Chetwood
Your post on FileDisassembler appeared as the page refreshed when I made my answer on FileDisassembler :-) You win.
ProfK
His Reflector link works, too, which is what took it. Thanks for helping me look less stupid to the client.
MusiGenesis
@musigenesis: No prob, that is what we are here for... I think...
Geoffrey Chetwood
My copy of Reflector has an "Export..." option and I have no plug-ins installed. It creates a VS project with all the source code and resources. So why is everyone suggesting FileDisassembler? It is better?
Lucas
Lucas: Out of the box, I have not seen reflector able to do this. FileDisassembler has always been the only way.This may have changed in recent history though I guess. I will check it out.
Geoffrey Chetwood
+8  A: 

You want reflector.

Luke Halliwell
+14  A: 

Reflector and the File Disassembler add-in from Denis Bauer. It actually produces source projects from assemblies, where Reflector on its own only displays the disassembled source.

ProfK
Thanks, but a little late ;)
Geoffrey Chetwood
A: 

.NET = Open Source. :)

There is also an addin for Reflector that lets you export the DLL or EXE to code file. Don't have the name at hand but there are a couple. I see someone already posted this information

Derek Smyth