.Net MVC 应用程序不断编译 - 我如何找出原因?
我正在网站上使用运行状况监控,它似乎每分钟左右甚至更频繁地重新编译。不过,我并不总是丢失会话状态。
这是我的 web.config 中的健康监控代码
<healthMonitoring enabled="true">
<eventMappings>
<clear/>
<add name="All Errors" type="System.Web.Management.WebBaseErrorEvent, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
<add name="Application Events" type="System.Web.Management.WebApplicationLifetimeEvent" startEventCode="0" endEventCode="2147483647"/>
</eventMappings>
<providers>
<clear/>
<add name="EmailErrorProvider" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="false" subjectPrefix="Error: " bodyHeader="This email is generated from my application."/>
<add name="EmailErrorProvider2" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="false" subjectPrefix="App Start / App End: " bodyHeader="This email is generated from my application."/>
</providers>
<rules>
<clear/>
<add name="Testing Mail Event Providers" eventName="All Errors" provider="EmailErrorProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/>
<add name="Application Events Default" eventName="Application Events" provider="EmailErrorProvider2" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
</rules>
</healthMonitoring>
这是一个通知:
** Events **
---------------
Event code: 1003
Event message: Application compilation is starting.
Event time: 11/3/2009 6:46:54 PM
Event time (UTC): 11/3/2009 11:46:54 PM
Event ID: dd8d7deee3c048b1bef67b77aa6849bc Event sequence: 3 Event occurrence: 2 Event detail code: 0
Process information:
Process ID: 6632
Process name: devenv.exe
Account name: Max-Acer\Max
---------------
I am using health monitoring on a site and it seems to recompile every minute or so or even more often. I do not always lose session state though.
Here is my Health Monitoring code from my web.config
<healthMonitoring enabled="true">
<eventMappings>
<clear/>
<add name="All Errors" type="System.Web.Management.WebBaseErrorEvent, System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647"/>
<add name="Application Events" type="System.Web.Management.WebApplicationLifetimeEvent" startEventCode="0" endEventCode="2147483647"/>
</eventMappings>
<providers>
<clear/>
<add name="EmailErrorProvider" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="false" subjectPrefix="Error: " bodyHeader="This email is generated from my application."/>
<add name="EmailErrorProvider2" type="System.Web.Management.SimpleMailWebEventProvider" to="[email protected]" from="[email protected]" buffer="false" subjectPrefix="App Start / App End: " bodyHeader="This email is generated from my application."/>
</providers>
<rules>
<clear/>
<add name="Testing Mail Event Providers" eventName="All Errors" provider="EmailErrorProvider" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/>
<add name="Application Events Default" eventName="Application Events" provider="EmailErrorProvider2" profile="Default" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
</rules>
</healthMonitoring>
Here is a notification:
** Events **
---------------
Event code: 1003
Event message: Application compilation is starting.
Event time: 11/3/2009 6:46:54 PM
Event time (UTC): 11/3/2009 11:46:54 PM
Event ID: dd8d7deee3c048b1bef67b77aa6849bc Event sequence: 3 Event occurrence: 2 Event detail code: 0
Process information:
Process ID: 6632
Process name: devenv.exe
Account name: Max-Acer\Max
---------------
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的猜测是它正在编译视图。尝试预编译您的视图,看看您是否仍然遇到相同的问题。
My guess would be that it's compiling views. Try pre-compiling your views and see if you still have the same problems.