Reputation: 37
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
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
Reputation: 13116
JustDecompile from Telerik will let you extract a project from your existing .net assembly and it is free.
Upvotes: 1
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