Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get source code of my published ASP.NET website from server

I've published my ASP.NET website to my Windows Server 2012 via Visual Studio.

But things happened, and I lost all of my sources. I had a backup but it is not recent enough. I could re-code everything that is missing but I don't remember all of it.

I was wondering if it's possible to get the source code from the server where I published my website ? I have a full access on it.

Thanks,

Hellcat8

like image 267
Hellcat8 Avatar asked Jan 06 '17 11:01

Hellcat8


2 Answers

Sorry to hear that!
An ASP.NET (WebForms) application consists of code-behind classes and .aspx pages. All the code-behind classes are compiled into a class library located in the bin folder in the root directory.
An ASP.NET (MVC) application has a similar structure, but with views instead with the .cshtml / .vbhtml extension(s).

If you've lost the back-end code for the application, you'll need to decompile the dll file to obtain your code back. Sadly, you'll lose all of the code comments so they'll need to be re-created.

Some decompilers: dotPeek, ILSpy, JustDecompile, Reflector

like image 51
Nathangrad Avatar answered Sep 21 '22 00:09

Nathangrad


I think that if you don't have a Repository or something similar but ONLY DLL's you can try with a Reverse enginnering tools...like:

http://www.red-gate.com/products/dotnet-development/reflector/
like image 21
federico scamuzzi Avatar answered Sep 18 '22 00:09

federico scamuzzi