出版/上传新DLL到IIS:网站宕机,同时上传 [英] Publishing/uploading new DLL to IIS: website goes down whilst uploading

查看:120
本文介绍了出版/上传新DLL到IIS:网站宕机,同时上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当上传一个大型Web应用程序一个新的DLL(DLL大约1MB)II​​S抛出一个错误,因为DLL是使用中,这意味着该网站已关闭,而DLL被上传。有没有办法制止这种行为?

When uploading a new DLL for a large web application (dll is around 1mb) IIS throws an error because the DLL is 'in-use', meaning the website is down while the DLL is being uploaded. Is there a way to stop this behaviour?

另外,虽然我使用的Web应用程序,而不是Web站点,每当我上传一个新的DLL,它仍然需要一段时间的IIS到一个新的上传后重启。我认为这通常等待只是为网站,因为他们需要通过IIS进行编译,不是Web应用程序?

Also, although I am using Web Applications, not Web Sites, whenever I upload a new DLL it still takes a while for IIS to restart after a fresh upload. I thought this wait was generally only for websites as they need to be compiled by IIS, not Web Applications?

推荐答案

只要你做出改变,如这个,你已经有效地改变依赖。该网站将需要ASP.NET的卷影副本的文件夹进行重新编译。

As soon as you make a change such as this you've effectively changed a dependency. The site will need to be recompiled in ASP.NET's shadow copy folders.

更新:

根据您的评论:如果有人在同一时间买进项目在电子商务网站新的更新被推出来?它的.NET我的错误熊(有一件事我错过关于PHP很容易被上传PHP文件没有麻烦)

如果你只有一台服务器,那么你需要计划你的更新,并给予一定的预先警告,该网站将不可用,由于升级。有一个在ASP.NET一个功能叫做 App_Offline.htm 。这是一个特殊的页面,当应用程序中的present会导致ASP.NET来呈现其内容无论被请求的页面。你可以用它来显示一个消息,说明用户,该网站是离线进行维护。你可以阅读更多关于它在这里 href=\"http://weblogs.asp.net/scottgu/archive/2005/10/06/426755.aspx\" rel=\"nofollow\">

If you've only got a single server then you need to plan your updates and give some advance warning that the site will be unavailable due to an upgrade. There's a feature in ASP.NET called App_Offline.htm. It's a special page which when present in your application will cause ASP.NET to render its contents no matter which page is requested. You can use this to display a message explaining to users that the site is offline for maintenance. You can read more about it here on Scott Guthrie's blog.

这不是不合理接近现场升级这种方式,因为它是在单个原子操作执行站点更新的机制,并提供给你的用户大量事前警告,他们不会介意(当或许这样做在一个时间你交通是一个典型的低点)。

It's not unreasonable to approach site upgrades this way because it's a mechanism to perform a site update in a single atomic step and provided you give users plenty of advance warning they won't mind (and perhaps do this at a time when your traffic is at a typical low point) .

您提到,在PHP中你不会有这个问题。其实,如果你要更新什么了,一对夫妇的非相关的页面,那么你应该是$ P $从作为一个理所当然的升级期间访问该网站的用户pventing。

You mention that in PHP you wouldn't have this problem. Actually, if you're updating anything more that a couple of non-related pages then you should be preventing users from accessing the site during upgrades as a matter course.

说你要更新五六页所有松散的 - 也许作为一个电子商务应用程序的一部分。在上载过程中,您部署的第一个页面,它就会提供给用户。你们中的一个来此页面所做的更改是一个新的字段添加到表单。页面回发到使用该领域的一个又一个PHP脚本。两种情况存在:

Say you're updating five or six pages all loosely related - perhaps as part of an e-commerce application. During the upload process you deploy the first page and it gets served to a user. One of the changes you made to this page was to add a a new field to a form. The page posts back to a another PHP script that uses this field. Two scenarios exist:


  1. 回发页面是新的,仍然在上传队列中。这打破了新上传脚本,因为当用户点击提交没有什么提交。

  1. The postback page is new and is still in your upload queue. This breaks the newly uploaded script because when a user clicks submit there is nothing to submit to.

回发页面已经存在,但一直没有更新。这页写入表格后场到数据库。您已经添加了这一新领域的数据库,但它是一个必填字段,并且不能为空。您没有尚未更新回发的脚本尝试更新数据库,但引发错误,因为新的领域是不是在回发形式的INSERT语句,从而为null导致违反NOT NULL约束。

The postback page already exists but hasn't been updated. This page writes the form post fields to a database. You've added this new field to the database but it's a mandatory field and can't be null. Your no-yet-updated postback script tries to update the DB but an error is raised because the new field isn't in the postback form's INSERT statement and thus is null causing a NOT NULL constraint violation.

我可以继续下去。如果您的网站提供了比功能只是一个微不足道的金额,那么你应该去离线的所有更新,以确保code被部署在单个原子更新所有你更新。

I could go on. If your site provides more than just a trivial amount of functionality then you should go offline for ALL updates to ensure that ALL you're updated code is deployed in a single atomic update.

这篇关于出版/上传新DLL到IIS:网站宕机,同时上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆