如何更新IIS中现有应用程序的dll并将其用于no。用户 [英] How to update dlls of an existing application in IIS while it is up and being used by a no. of users.

查看:181
本文介绍了如何更新IIS中现有应用程序的dll并将其用于no。用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在应用程序中有一些要更新的dll,但该应用程序目前正被一个号码使用。用户是否有任何进程停止IIS 1分钟或类似的事情并更新dll?



还有另一个问题,如果用户正在进行交易,我停止了应用程序,可能存在一些问题。我需要以这样的方式停止应用程序,即交易不应该提交,不完整的数据不应该输入到dB。



是否有正确的停止方法申请1分钟并在IIS中更新文件?



提前多多谢谢。

解决方案

假设您要更新的文件位于应用程序的 bin 目录中,您只需将新文件复制到目录中即可。



ASP.NET生成文件的卷影副本,并从副本加载它们。更新文件时,它会创建一个新的AppDomain来为任何新请求提供服务,并在完成为任何当前请求提供服务后立即通知先前的AppDomain关闭。



卷影复制和你的\bin目录 [ ^ ]


只需注意:操作系统不允许删除或修改当前加载到内存中以供执行的任何模块(PE文件)。所以,对于组件来说也是如此。但是ASP.NET代码通常以源代码的形式部署,您可以随时更新。



-SA

Hi All,

I have some dlls to update in an application, but the application is currently being used by a no. of users. Is there any process to stop the IIS for 1 mins or something like that and update the dlls?

Also there is another problem, if a user is doing a transaction and I stopped the application, there might be some problem. I need to stop the application in such a way that the transaction should not be committed and incomplete data should not enter to the dB.

Is there a proper approach to stop the application for 1 min and update files in IIS?

Thanks a lot in advance.

解决方案

Assuming the files you want to update are located in the application's bin directory, you can just copy the new files into the directory.

ASP.NET makes a "shadow copy" of the files, and loads them from the copy. When you update the files, it creates a new AppDomain to service any new requests, and signals the previous AppDomain to shut down as soon as it has finished servicing any current requests.

Shadow Copy and your \bin directory[^]


Just a note: the OS won't allow to remove or modify any module (PE file) currently loaded in memory for execution. So, this is true for assemblies. But the ASP.NET code is typically deployed in the form of source code, which you can update at any time.

—SA


这篇关于如何更新IIS中现有应用程序的dll并将其用于no。用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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