问题
I have a web application built in Asp.net framework 3.5 (.Net 2008), and I use a Web Deployment Project (WDP) to compile it.
I'd like to know, for instance if I made some changes to a code behind file (.aspx.vb), what files do I need to upload to the production server in order to get the new changes updated there. Same thing in the case of .aspx files.
I know that I can copy the whole web application directory to the production server, but, can I copy just the updated files?
any guide will be appreciated.
回答1:
As you know a class is a consolidated list of three files in case of Web Application
- ASPX
- Designer
- Code Behind
Case - 1 Changes made in one file(.aspx/.cs/ .designer.cs)
Suppose in your project you have 50 - 100 files and you made change in single file and it's impact caused in all the above three mentioned files. In that case you need not to upload all published files on Deployment Server. You need to replace the rebuild files for following.
- Web Application DLL file
- ASPX Page
Case - 2 When changes made in Script files like .css or .Js
- In this case you need not to replace the Web Application Dll
- Replace only .css or .js files.
Hope this may help you in your deployment process and may save you lot of time
回答2:
replacing only projectname.dll will reflect your changes as far as you did not make any changes in HTML of any page otherwise you have to replace aspx pages also
AFAIK you don't need any files to upload from deployment project still have a backup of your current project.dll or may be whole project(if you can afford) before uploading the new one on server just for the sake of safety
Web Deployment projects do not change the way Visual Studio 2010 Web Sites or Web Application Projects build. Instead, they take an existing Visual Studio Web project as input and generate a precompiled Web as an output. A Web Deployment Project does not change the files in the source Web site project in any way.
it is stated here
来源:https://stackoverflow.com/questions/9297312/what-to-copy-to-production-server-when-an-update-is-made-in-a-web-application-de