Search code examples
c#asp.netwindows-server-2012

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


Solution

  • 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