Can I recreate the source code and solution files for an ASP.NET website?

≯℡__Kan透↙ 提交于 2020-01-06 03:28:04

问题


I have a client that had an ASP.net web-forms website built for him.

He is not able to contact the original developer, but he would like to make some changes to the website (adding pages and changing existing ones).

I have the production files from the ftp site, but that is all that I am able to retrieve.

Is it possible to create the source code and solution files with only the production files, or does he have to start over from scratch with the site?


回答1:


Depends on what kind of web-forms project you have.

If you have a compiled but updatable website-project, there are .vb/.cs and .aspx files on the server. Then you can just create a VB.NET/C# website-project and drag-and-drop the file in from explorer.
You'll have to add dependencies (e.g. DLLs in the bin folder) manually, but you should be able to compile the project in under an hour.

If it's a compiled project, you can use ILSpy to decompile the DLLs, including project.
However, unlike decompiling WinForms applications, decompiling an ASP.NET application will probably not result in a compilable project. But it's as close as you can get. If it compiles, it will probably not run fine. You're looking at about a week worth of work for a not too complex application.

Also, if it's a web-forms project and not too complex, I'd start over again (maybe copy the HTML/CSS markup and images, if possible). I'd redo it in ASP.NET MVC (5 is the latest version - I believe - 6 will include major changes).

WebForms project do things by PostBacks, and that makes it technically pretty badly testable, and worse, it's very slow. Plus you run into problems once you start to mix Postbacks (page-reloads) with JavaScript. So I'd start over with MVC and jQuery and AJAX (not Microsoft Ajax controls). That's just my 5 cents.



来源:https://stackoverflow.com/questions/24777619/can-i-recreate-the-source-code-and-solution-files-for-an-asp-net-website

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