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

不羁的心 提交于 2021-01-27 06:13:28

问题


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


回答1:


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




回答2:


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/


来源:https://stackoverflow.com/questions/41504504/get-source-code-of-my-published-asp-net-website-from-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!