[英]Stop ASP.Net from recycling app pool due to “changes to the bin”
问候,我有一个大型的.Net Web应用程序,该应用程序在具有基于NAS的代码的刀片服务器场上运行。 偶尔,nas响应时间的细微波动会导致.NET认为bin中的某些内容已更改,从而开始了应用程序池的回收。 实际上没有发生任何变化。 有没有一种方法可以禁用.Net对bin更改的监视?
这将结束它。 现在,您必须执行iisreset
来回收您的应用程序池。
'This is supposed to turn off the monitoring for directory deletes
'See https://connect.microsoft.com/VisualStudio/feedback/Workaround.aspx?FeedbackID=240686
'This incurs the penalty 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() {})
简单的答案是,您不能。 如果IIS在二进制文件之一中检测到更改,则必须重新加载以确保它使用的二进制文件正确。
真正的问题是:a)IIS是否真正检测到更改,或者是由于“波动”导致OS认为内存中没有文件? b)如果“波动”是问题的根源,是什么原因造成的? 如何解决?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.