Question

we have an application in production and the code is in Pre-Compiled form. The developer who developed that application left the company and we don't have any backup of source code. the only access we have is Pre Compiled code in the server. We need to fix the issues in the application now.

Is there any way to Decompile (extract to actual source code) the PreCompiled code ?

Was it helpful?

Solution

Open the DLLs in the .NET Reflector.

OTHER TIPS

To update @xOn's answer:

Due to a recent source control disaster I had to recover my project from the DLLs. So sadly I'm knowledgable on the procedure:

  1. Get .Net Reflector from here: http://www.red-gate.com/products/dotnet-development/reflector/

  2. You do not seem to need FileDisassembler.

  3. Either load your bins in Reflector or double click them.

  4. Mind that the .Net framework might have not maintained your original project file structure. So if some of your ASPX pages shared the same basic class name in different .cs files (I.E. Inherits tag is the same, but CodeFile tag differs), you would not be able to simply "export source code". Don't go blindly exporting source files. It won't work.

  5. There will still be some work to be done before being able to just fire up the old build button. For example - DLLs can refer to property's getter/setters directly. You will have to fix that.

Good luck.

Start with:

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

...plus:

http://www.denisbauer.com/NETTools/FileDisassembler.aspx

You'll have to recompile the latter to link it against v6.5 of reflector (the latest, as of this post.) It is a good add-on if you want to avoid having to copy and paste ever single class into files by hand. It will dump an entirely assembly as .cs files. I think it may even generate a csproj.

Both tools are free.

I had the similar issue and used Reflector to Decompile it. I got the source code, then changed the bit I wanted, and rebuild it. Then I copied that dll again to Production site. It started to reflect my changes. It was very easy and not at all difficult, maybe because Precompiled site had dlls for every page, and was updatable , so had only code-behind file in dll.

For reference: http://www.reflector.net/

When u install .net reflecter.its import in visual studio. then you saw the .net reflector tools on menu bar.

Click on .net reflector >>Choose Asseblies (Dll file) to debug.

I found that dll can be just Read using the .NET Reflector tool but can't extract the Source Code. And also once the webforms are precompiled, we can't even get back the code behind files. All we can do is to debug and analyze the Code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top