Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

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? And their contents?

I know I can try it out myself, but more importantly, I'm looking for proper documentation for this.

like image 822
Ron Klein Avatar asked Mar 21 '12 10:03

Ron Klein


People also ask

How often does application Pool recycle?

You can specify that IIS recycle an application pool at set intervals (such as every 180 minutes), at a specific time each day, or after the application pool receives a certain number of requests.

What causes app pool to recycle?

Application pool(s) recycle. The worker process hosting your applications can recycle due to a configuration change, time limit, idle timeout, excessive memory usage, and many other reasons. Application restart(s).


2 Answers

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.

Abrupt Application Pool Recycling

  1. Any modifications in the Application’s BIN Directory

  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).

  3. Making modifications in the Source code files in APP_CODE Directory. This maybe change in any Source code files, or adding or deleting files from this directory.

  4. Making changes in the Global.asax file

  5. Making Changes in the Machine.config file.

  6. Making any modifications in the Web Application’s Root Directory. 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.

  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?
  2. http://christopherdeweese.com/blog2/post/beware-writing-to-the-bin-folder-in-iis-hosted-services
  3. What does an IISReset do?
  4. http://www.iis.net/ConfigReference/system.applicationHost/applicationPools/add/recycling
  5. Managing, Tuning, and Configuring Application Pools in IIS 7.0
  6. http://varunvns.wordpress.com/2011/07/04/application-pool-restarts/
like image 112
Tim Schmelter Avatar answered Sep 24 '22 00:09

Tim Schmelter


NOPE, updating a dll file in the bin folder DOES NOT cause a recycle. At least not with .NET 4.7 on IIS 10 and later

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)

What happens when you update a file in /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. I.e. reloads the "app-domain". But this happens within the same w3wp process. (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.

like image 35
Alex from Jitbit Avatar answered Sep 24 '22 00:09

Alex from Jitbit