views:

344

answers:

3

Greetings, I have a large .Net web app which runs on a farm of blades with the code base on a NAS. Every once in a while slight fluctuations in the response time of the nas cause .NET to think that something in the bin has changed and kick off a recycle of the app pool. No change has actually occurred. Is there a way to disable .Net's monitoring of changes to the bin?

A: 

The simple answer is, you cannot. If IIS detects a change in one of the binaries, it must reload in order to ensure that it is using the correct binaries.

The real questions are: a) Is IIS truly detecting a change, or is it due to the "fluctuation" causing the OS to think the files aren't there momemtarily? b) If the "fluctuations" are the root of the issue, what is causing them? How can that be addressed?

palehorse
Well, that's the big question, and one we are looking into as well. I was just hoping there would be a stopgap solution because the nas issue may be bigger.
ryber
A: 

This will put an end to it. Now you must do iisreset to recycle your app pool.

'This is supposed to turn off the monitoring for directory deletes
'See https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=240686
'This incurrs the penelty of an IISRESET or manually restarting the containing AppPool after every upgrade.
Dim pi As PropertyInfo
Dim o As Object
Dim m As MethodInfo
pi = GetType(System.Web.HttpRuntime).GetProperty("FileChangesMonitor", BindingFlags.NonPublic Or BindingFlags.Public Or BindingFlags.Static)
o = pi.GetValue(Nothing, Nothing)
m = o.GetType().GetMethod("Stop", BindingFlags.Instance Or BindingFlags.NonPublic)
m.Invoke(o, New Object() {})
Joshua
A: 

There also seems to be a hot fix that appears to be able to disable the "feature" with a Registry entry:

http://support.microsoft.com/kb/911272

Not entirely sure that this works on the bin or not.

ryber