Dave
Dave

Reputation: 37

Open my own executable in VisualStudio

I wrote a c# console application in VS2012 and everything was working perfectly so I put the .exe file out on our servers for people to use.

Stupidly before adding it to source control I made some edits to the project and now it's not working. Is there a way to extract my working code from the working exe file, or am I stuck trying to rebuild from my memory?

Upvotes: 1

Views: 100

Answers (4)

quarksoup
quarksoup

Reputation: 129

I like IlSpy as a free decompiler. http://ilspy.net/

Upvotes: 0

Ben Voigt
Ben Voigt

Reputation: 283911

A decompiler will give you "working code", but it won't be "your" working code.

All the comments and local variable names will be gone. New temporary variables will be added. And some coding constructs (i.e. whether a loop was for, while, or do-while) may be expressed differently but equivalently.

So, the decompiler is useful to help you confirm your memory (was this change I'm about to check in included in that version or not?), but not for getting back source control-ready code.

Upvotes: 1

Mike Cheel
Mike Cheel

Reputation: 13116

JustDecompile from Telerik will let you extract a project from your existing .net assembly and it is free.

Upvotes: 1

Florian F.
Florian F.

Reputation: 4700

Yes you can decompile your .Net code from your executable.

.Net Reflector does the thing rather well and can even regenerate your entire solution.

Upvotes: 1

Related Questions