title: IIS recycles site every time a css file is modified
body: <p>I develop a site on my local box using VS.NET 2013 and I have IIS pointing to my local drive where the files are. My site requires me to login, so I'll login and navigate to a page.  If I see a style on that page that needs to be fixed, I'll edit the css file and try to refresh the page in my browser.  But the site kicks me off and forces me to login again, which is caused by the IIS site recycling because of the .css file edit.</p>
  
  <p>Is there a way to prevent it from recycling for a css file edit? I noticed that I can usually modify .aspx pages without the recycle.  The site is a mix of ASPX and MVC pages.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I develop in VS.NET, but I don't run it on my box thru IIS Express, but thru IIS itself.</p>
  
  <p>I am only editing the .css file and eventually after a few saves, the site recycles.  I've also tried editing the .css file in notepad and those edits eventually recycle the site as well.</p>
  
  <p>I did add ScottGu's code (<a href="http://weblogs.asp.net/scottgu/433194" rel="nofollow">http://weblogs.asp.net/scottgu/433194</a>) to Application_End() that logs what the shutdown reason was, and what it is reporting is the following:</p>
  
  <pre><code>_shutDownMessage=Change in App_Offline.htm
  HostingEnvironment initiated shutdown
  Change in App_Offline.htm
  Change in App_Offline.htm
  Change in App_Offline.htm
  Change in App_Offline.htm
  Change in App_Offline.htm
  Change in App_Offline.htm
  Change in App_Offline.htm
  HostingEnvironment caused shutdown
  
  _shutDownStack=   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
     at System.Environment.get_StackTrace()
     at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()
     at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace)
     at System.Web.HttpRuntime.OnAppOfflineFileChange(Object sender, FileChangeEvent e)
     at System.Web.DirectoryMonitor.FireNotifications()
     at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback)
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
     at System.Threading.ThreadPoolWorkQueue.Dispatch()
  </code></pre>
  
  <p>I don't know how app_offline.htm is getting modified as I am not touching it. In fact, I do not have a file named app_offline.htm because if I did, I would not be able to see the site/login/etc.</p>
  
  <p>Sounds like I need to get a file watcher and see who is touching it, but I suspect something else is touching app_offline.htm in order to trigger a recycle.</p>