2

Pardon me if I get most of the terminologies wrong but I'll try my best to explain the scenario and what I have researched and done so far.

We had a developer that developed a software, which is an ASP.NET MVC web application with API's included in the project but he has left the company, and we cannot find the source code and I need to manage and maintain the software. I have read up on Intermediate Language and Decompilers (ILSpy).

I was able to decompile the dll and gotten all the codes however, all the articles I read stopped short at only decompiling the dll to generate the source code but none seem to have successfully been able to explain how to generate the other files and folders (e.g Views > Home > Index e.t.c ). Or is the only solution a manual process, where I have to manually create all the cshtml files within all the View(s) folder. Is there a better way to achieve this? Thank you

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
kachidude
  • 31
  • 1
  • 5
  • 2
    Any way you look at it, this will be painful -- painful to get compiling, then painful to maintain over the long haul. I don't normally advocate for "starting over" when it comes to legacy systems, but in this case I think you'll be better off attempting to re-implement, and just use the old system as a very thorough spec – Gus Nov 01 '19 at 12:55
  • 1
    And start using a version control system and some backup strategy! – user743414 Nov 01 '19 at 12:55
  • No experiences here, so just trying to think logically. You won't get the folder structure nor the supporting files (e.g. .csproj) There will be much guesswork to be done. From the DLLs in your project you can guess what NuGet packages were used. The namespaces can give a few hints for the directory structure. You most likely won't get Razor syntax and .cshtml and codebehind will merged into the same class. Client side scripts are not compiled but reengineering build and deployment scripts won't be easy as well. Wouldn't it be easier to just ask for the code? – Daniel Schmid Nov 01 '19 at 13:09
  • Unless your view pages are [compiled into the dll](https://stackoverflow.com/q/5500078/1462295) the active website should have .cshtml files in the correct directory structure already. – BurnsBA Nov 01 '19 at 13:39
  • The main thing that a software developer is *write source code*. If you're not ultra careful about making sure that the source code is maintained safely, then you shouldn't be writing source code. I realize that it may not have been in your control.....but I'd really question the value of working for a company that doesn't take maintaining their data seriously. – mason Nov 01 '19 at 14:10

1 Answers1

0

In your case it's possible to use '.NET Reflector' with 'Reflector.FileDisassembler' which wil allow you to recover the code througth your assemblies you will find the link below .

Download '.Net Reflactor' first ,then you can add 'File Disassembler' as an add-in, in the end click right on your assemblie and choose Export Source Code

.Net Reflector : https://www.red-gate.com/dynamic/products/dotnet-development/reflector

File Disassembler : http://old.denisbauer.com/Home/ReflectorFileDisassembler

sayah imad
  • 1,507
  • 3
  • 16
  • 24