您如何更新ASP.NET Web应用程序?

时间:2022-04-26 04:14:26

Simple question. If you have a compiled and published ASP.NET web application running on a server and you need to update, say, a line in one of the codebehind files. Do you shut down the entire site, republish, then load the site back up? Or do you publish straight to your live site with users still using it?

简单的问题。如果您在服务器上运行已编译和发布的ASP.NET Web应用程序,则需要更新其中一个代码隐藏文件中的一行。您是否关闭整个站点,重新发布,然后重新加载该站点?或者您是否仍然使用它直接发布到您的实际网站?

3 个解决方案

#1


1  

For myself, place an app.offline app_offline.htm file into the site, then overwrite the entire website with the latest published build.

对于我自己,将app.offline app_offline.htm文件放入网站,然后使用最新发布的版本覆盖整个网站。

there are a few options when building a site -> one dll for the site or one per page. if u just updated one line in a code behind, and you have chosen the build option for one per page, then you can just copy/paste that new page dll.

构建网站时有一些选项 - >网站的一个dll或每个网站一个。如果您刚刚在后面的代码中更新了一行,并且您已经为每页选择了一个构建选项,那么您可以复制/粘贴该新页面dll。

i don't like that method personally. I find it simple to app_offline.htm the site.

我个人不喜欢那种方法。我觉得app_offline.htm网站很简单。

#2


0  

If it is a single file and a simple site that uses that app_code folder to store the code behinds, I simply xcopy up the new files. If I use http expiration headers I may need to do some better scheduling to make sure things like javascript files and css sheets match the rest of the site that was updated.

如果它是一个单独的文件和一个使用该app_code文件夹来存储代码的简单站点,我只需复制新文件。如果我使用http过期标头,我可能需要做一些更好的安排,以确保javascript文件和css表等内容与更新的网站的其余部分相匹配。

#3


0  

For emergency patches:

对于紧急补丁:

If its just a codebehind file, I copy the entire /bin/ out and replace all DLL's (mostly out of habit)

如果它只是一个代码隐藏文件,我复制整个/ bin / out并替换所有DLL(主要是出于习惯)

If its an aspx, I just copy the aspx.

如果它是一个aspx,我只是复制aspx。

For actual deployments, I have an automated system that checks out the code from source control, builds a clean release build, takes the site offline, and then robocopies it out to the deployment target. Its a one click process (Thanks CruiseControl!).

对于实际部署,我有一个自动化系统,可以从源代码控制中检出代码,构建一个干净的版本构建,使站点脱机,然后将其复制到部署目标。它是一键式过程(感谢CruiseControl!)。

#1


1  

For myself, place an app.offline app_offline.htm file into the site, then overwrite the entire website with the latest published build.

对于我自己,将app.offline app_offline.htm文件放入网站,然后使用最新发布的版本覆盖整个网站。

there are a few options when building a site -> one dll for the site or one per page. if u just updated one line in a code behind, and you have chosen the build option for one per page, then you can just copy/paste that new page dll.

构建网站时有一些选项 - >网站的一个dll或每个网站一个。如果您刚刚在后面的代码中更新了一行,并且您已经为每页选择了一个构建选项,那么您可以复制/粘贴该新页面dll。

i don't like that method personally. I find it simple to app_offline.htm the site.

我个人不喜欢那种方法。我觉得app_offline.htm网站很简单。

#2


0  

If it is a single file and a simple site that uses that app_code folder to store the code behinds, I simply xcopy up the new files. If I use http expiration headers I may need to do some better scheduling to make sure things like javascript files and css sheets match the rest of the site that was updated.

如果它是一个单独的文件和一个使用该app_code文件夹来存储代码的简单站点,我只需复制新文件。如果我使用http过期标头,我可能需要做一些更好的安排,以确保javascript文件和css表等内容与更新的网站的其余部分相匹配。

#3


0  

For emergency patches:

对于紧急补丁:

If its just a codebehind file, I copy the entire /bin/ out and replace all DLL's (mostly out of habit)

如果它只是一个代码隐藏文件,我复制整个/ bin / out并替换所有DLL(主要是出于习惯)

If its an aspx, I just copy the aspx.

如果它是一个aspx,我只是复制aspx。

For actual deployments, I have an automated system that checks out the code from source control, builds a clean release build, takes the site offline, and then robocopies it out to the deployment target. Its a one click process (Thanks CruiseControl!).

对于实际部署,我有一个自动化系统,可以从源代码控制中检出代码,构建一个干净的版本构建,使站点脱机,然后将其复制到部署目标。它是一键式过程(感谢CruiseControl!)。