0

I have a deployed .Net project(debug version). It doesn't have any of the code behind files.

What I would like to do is get back the original project including the c# files in the right folders.

Jay Jay Jay
  • 1,970
  • 2
  • 25
  • 47
  • 2
    How did you deploy it without compiling the source files? Is this **your** project or a third party? You can use [Reflector](http://www.red-gate.com/products/dotnet-development/reflector/) or an alternative decompiler to see the code. – Cᴏʀʏ Apr 18 '13 at 21:47
  • 4
    Just get the source code from the SCM you are using. – Andrew Savinykh Apr 18 '13 at 21:52
  • 1
    FYI - For whoever voted to close as off topic: discussion of "software tools commonly used by programmers" is perfectly fine. – NotMe Apr 18 '13 at 22:27
  • This is not actually possible. At best, you can resuscitate the code in the EXE. You can't actually restore the file system of your original project. That information is not saved in the EXE. – Cody Gray - on strike Apr 19 '13 at 03:51
  • It is the debug version of the project plus you have the pdbs. So @cody-gray it should be possible – Jay Jay Jay Jun 04 '13 at 14:46
  • I believe you want to "Decompile an Executable(exe)", right? "Published Net Project" doesn't ring a bell until I remember what a "Published Net Project" is... -But still, it would have been better to label this question "Decompile an Executable? C#" – Momoro Oct 30 '19 at 19:23

2 Answers2

5

You need to use a decompilation toolkit like the free Jetbrains dotPeek.

I see that Chris has recommended Redgate's .Net Reflector - historically this was good but has become slow and bloated as of late not to mention it is no longer free. Would highly recommend dotPeek over it.

Callum Rogers
  • 15,630
  • 17
  • 67
  • 90
2

You want reflector: http://www.red-gate.com/products/dotnet-development/reflector/

It's purpose is to reverse engineer assemblies. As long as these weren't compiled with an obfuscator you ought to be good. Bear in mind that the last time I had to do this to decompile a website, there was a LOT of work that still needed to occur to get the code back into a usable state.

If this was your fault, use source control next time... If you are picking up from someone else's mess, make sure you charge extra and recommend they use source control. If that someone else had purposely destroyed code, recommend that they be sued.

Note that I've also used the above to dig into LINQ (a few years ago) to locate some interesting bugs. It's a pretty good tool.

NotMe
  • 87,343
  • 27
  • 171
  • 245