ASP.NET HttpApplication lifecycle

前端 未结 2 1970
一整个雨季
一整个雨季 2021-01-17 17:20

Does the HttpApplication class extended by Global.asax.cs exist for the lifetime of the application?

At what point can instances be created/destroyed?

I\'m e

相关标签:
2条回答
  • 2021-01-17 17:36

    From the MSDN online page,

    After all core application objects have been initialized, the application is started by creating an instance of the HttpApplication class. If the application has a Global.asax file, ASP.NET instead creates an instance of the Global.asax class that is derived from the HttpApplication class and uses the derived class to represent the application.

    ASP.NET Application Life Cycle Overview

    0 讨论(0)
  • 2021-01-17 17:39

    If you are seeing the event twice in your logs, check that the application pool is set to spawn a single worker process. Each worker process will create its own instance of the HttpAppication.

    0 讨论(0)
提交回复
热议问题