Application_Start()被多次调用 [英] Application_Start() gets called more than once

查看:356
本文介绍了Application_Start()被多次调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net mvc 2上有一个应用程序,它在我的电脑上的IIS 7.5上我尝试对其进行分析,我注意到Application_Start被称为不止一次

有人知道为什么会这样吗?

I have an application made on asp.net mvc 2 and it is on IIS 7.5 on my pc I tried profiling it and I noticed that Application_Start gets called more than once,
anybody knows why is this happening ?

推荐答案

Application_Start 在加载应用程序域时触发事件一次。如果你看到它不止一次触发,那么这意味着应用程序重新启动。应用程序域可以卸载有多种原因,例如删除修改某些文件,如 web.config bin 文件夹,...这是描述应用程序重启的常见原因的文章。

The Application_Start event is fired once when the application domain is loaded. If you see it firing more than once then this would mean that the application restarts. There are multiple reasons an application domain could get unloaded like deleting modifying some of the files like web.config, the bin folder, ... Here's an article describing common reasons for application restart.

这篇关于Application_Start()被多次调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆