Run Application_Start immediately when application pool restarts in IIS

后端 未结 2 1746
栀梦
栀梦 2020-12-16 17:32

We are doing some caching operations in the application_start phase in the application. So all the cache is going away when the application pool restarts. Is it possible to

2条回答
  •  旧巷少年郎
    2020-12-16 18:25

    You could use Application Initialization for IIS 7.5, it borrows functionality from IIS8, or if you are using ASP.NET 4.0 + there is application auto start.

    For ASP.NET 2.0 i 3.5 there is a IMO somewhat hackish solution, you can log application pool recycle in Event log and then in event log set a task that will be performed on that event, here are the details

提交回复
热议问题