[英]Does any change in any file inside bin folder cause application recycle in ASP.NET web application?
I know that in ASP.NET web application, changing a DLL file located in the bin
folder causes an application recycle.我知道在 ASP.NET Web 应用程序中,更改位于
bin
文件夹中的 DLL 文件会导致应用程序回收。
But I wonder, as the subject implies, whether any file changes cause such behavior?但我想知道,正如主题所暗示的那样,是否有任何文件更改会导致这种行为? Are simple text files included in this scenario?
此方案中是否包含简单的文本文件?
And what about sub folders to bin
folder?那么子文件夹到
bin
文件夹呢? And their contents?以及它们的内容?
I know I can try it out myself, but more importantly, I'm looking for proper documentation for this.我知道我可以自己尝试一下,但更重要的是,我正在为此寻找合适的文档。
First, i can not provide a link to an official documentation.首先,我无法提供官方文档的链接。 But from what i've read every change in the bin-folder(incl. subfolders) will cause the IIS to recycle the application domain.
但是从我读到的 bin 文件夹(包括子文件夹)中的每个更改都将导致 IIS 回收应用程序域。
Abrupt Application Pool Recycling突然的应用程序池回收
Any modifications in the Application's BIN Directory应用程序的 BIN 目录中的任何修改
Making changes in any Configuration File/s, like Web.config or others ( if you have any specific config file in your application say in a directory called App_Config).在任何配置文件中进行更改,如 Web.config 或其他(如果您的应用程序中有任何特定的配置文件,请说在名为 App_Config 的目录中)。
Making modifications in the Source code files in APP_CODE Directory.在 APP_CODE 目录中的源代码文件中进行修改。 This maybe change in any Source code files, or adding or deleting files from this directory.
这可能会更改任何源代码文件,或者从此目录中添加或删除文件。
Making changes in the Global.asax file在 Global.asax 文件中进行更改
Making Changes in the Machine.config file.在 Machine.config 文件中进行更改。
Making any modifications in the Web Application's Root Directory.在 Web 应用程序的根目录中进行任何修改。 This means creating files/subdirectories on the fly can lead to application pool recycling.
这意味着动态创建文件/子目录可能会导致应用程序池回收。
Modifications for references of Web Services of App_WebReferences directory.修改 App_WebReferences 目录的 Web Services 引用。
Modifying the Security Settings of any directory in the Root directory.修改根目录中任意目录的安全设置。 (Like specifying read security rights for everyone or any other specific user or user group.)
(例如为每个人或任何其他特定用户或用户组指定读取安全权限。)
Here's some reading:这是一些阅读:
NOPE, updating a dll file in the bin folder DOES NOT cause a recycle.不,更新 bin 文件夹中的 dll 文件不会导致回收。 At least not with .NET 4.7 on IIS 10 and later
至少不适用于 IIS 10 及更高版本上的 .NET 4.7
It's when IIS launches a new instance of w3wp
process and the old one is being "politely" terminated (after finishing up on all the requests and background tasks registered with IRegisteredObject
)这是当 IIS 启动
w3wp
进程的新实例并且旧的实例被“礼貌地”终止时(在完成所有使用IRegisteredObject
注册的请求和后台任务IRegisteredObject
)
ASP.NET does a hot-reload: it detects the update and uses the new version of the .dll for new page requests from then on. ASP.NET 执行热重载:它检测更新并从那时起使用新版本的 .dll 来请求新页面。 Ie reloads the "app-domain".
即重新加载“应用程序域”。 But this happens within the same
w3wp
process.但这发生在同一个
w3wp
进程中。 ( source ) ( 来源)
I just checked this on IIS 10 windows 2016 machine: launched Task Manager and repalce the main .dll file - the w3wp
process kept running, nothing happened.我刚刚在 IIS 10 windows 2016 机器上检查了这个:启动任务管理器并重新安装主 .dll 文件 -
w3wp
进程继续运行,什么也没发生。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.