简体   繁体   English

bin 文件夹内任何文件的任何更改是否会导致 ASP.NET Web 应用程序中的应用程序回收?

[英]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突然的应用程序池回收

  1. Any modifications in the Application's BIN Directory应用程序的 BIN 目录中的任何修改

  2. 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 的目录中)。

  3. 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.这可能会更改任何源代码文件,或者从此目录中添加或删除文件。

  4. Making changes in the Global.asax file在 Global.asax 文件中进行更改

  5. Making Changes in the Machine.config file.在 Machine.config 文件中进行更改。

  6. 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.这意味着动态创建文件/子目录可能会导致应用程序池回收。

  7. Modifications for references of Web Services of App_WebReferences directory.修改 App_WebReferences 目录的 Web Services 引用。

  8. 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:这是一些阅读:

  1. What causes an application pool in IIS to recycle? 是什么导致 IIS 中的应用程序池回收?
  2. http://christopherdeweese.com/blog2/post/beware-writing-to-the-bin-folder-in-iis-hosted-services http://christopherdeweese.com/blog2/post/beware-writing-to-the-bin-folder-in-iis-hosted-services
  3. What does an IISReset do? IISReset 有什么作用?
  4. http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/recycling http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/recycling
  5. Managing, Tuning, and Configuring Application Pools in IIS 7.0在 IIS 7.0 中管理、调整和配置应用程序池
  6. http://varunvns.wordpress.com/2011/07/04/application-pool-restarts/ http://varunvns.wordpress.com/2011/07/04/application-pool-restarts/

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

First, what is a "recycle"?首先,什么是“回收”?

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

What happens when you update a file in /bin?当您更新 /bin 中的文件时会发生什么?

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.

相关问题 为什么我的asp.net应用程序在删除文件夹时会回收? - Why does my asp.net application recycle when I delete a folder? 我的ASP.NET Web应用程序无法“找到”App_Code文件夹中的任何类..? - My ASP.NET Web Application cannot 'find' any of my classes in the App_Code folder ..? 如何在生产服务器中回收asp.net Web应用程序? - How to recycle my asp.net web application in production server? 在我的asp.net mvc Web应用程序中使用带有WebClient()的Parallel.Foreach有任何缺点或风险吗? - are there any drawbacks or risks of using Parallel.Foreach with WebClient() inside my asp.net mvc web application 有什么方法可以为ASP.Net Web应用程序安装程序创建补丁? - Is there any way to create a patch for an ASP.Net web application installer? 什么时候在任何asp.net Web应用程序中创建会话? - when does a session get created in any asp.net web application? 如何访问放置在ASP.NET Web应用程序内部通用文件夹中的文件 - How to access a file placed in a generic Folder inside of an ASP.NET Web Application ASP.Net Web 应用程序无法读取文件夹中的文件 - ASP.Net web application cannot read a file within folder 更改ASP.NET应用程序中的任何子目录或文件是否会回收应用程序池 - Does changing any sub-directory or file in an ASP.NET application recycles the app pool 如何更改ASP .NET Web服务应用程序的生成路径而不是bin文件夹? - How to change asp .net web service application build path instead of bin folder?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM