开发者

Application_Start ASP.NET

开发者 https://www.devze.com 2023-03-29 05:11 出处:网络
If get this from the Microsoft official documentation: The Application_Start and Application_End methods are special methods that do not represent HttpApplication events. ASP.NET calls them once for

If get this from the Microsoft official documentation:

The Application_Start and Application_End methods are special methods that do not represent HttpApplication events. ASP.NET calls them once for the lifetime of the application domain, not for each HttpApplication instance.

I was sure that Application_Start was related to the HttpApplication, here this guy explains why I was wrong. Which object/entity is related to the Application_Start e开发者_JS百科vent?


As the documentation says, the events are linked to the lifetime of the application domain, which in practice means the app pool which the application is running in. Application_Start will fire again if the app pool is recycled for any reason - a change to web.config, for example.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号