2009-10-14 25 views
2

下面是从我的Global.asax片断:帮助调试 - Application_Start何时在global.asax文件中运行?

<script runat="server"> 
    void Application_Start(object sender, EventArgs e) { 
     // log this call 
     EventLogger.Log("ApplicationStart"); 
    } 

    void Application_BeginRequest(object sender, EventArgs e) { 
     // log what the user is doing 
     UsageLogger.Log(UsageLogger.GetServerVariables()); 
    } 
</script> 

当我打开日志,我看到使用电话穿插许多ApplicationStart电话。为什么我的应用程序似乎重新启动很多?

回答

2

这取决于IIS配置。默认值是20分钟。如果在此期间没有请求,应用程序将自动重启。

+1

你能指点我一些文档吗?这将是非常有益的,谢谢。 – 2009-10-14 18:33:09