Can you prevent your ASP.NET application from shutting down?

后端 未结 4 2041
长情又很酷
长情又很酷 2020-11-28 12:58

I think I heard that ASP.NET applications will shut down after a while of being idle (i.e. no visitors).

Is there a way to prevent this behavior from happening? I h

4条回答
  •  盖世英雄少女心
    2020-11-28 13:17

    Go to your task manager and kill w3wp.exe (or aspnet_wp). Nothing can stop you from doing this. Bottom line, ASP.NET applications cannot assume continuous functionality.

    However, you can launch a separate thread, which will not be subject to idle timeouts -- as long as it has something to do. I've used this technique to control a 45-minute import that would continue whether or not anyone was on the web site. I used a transaction log and Application_Start so that when the process was recycled, it would pick up where it left off.

提交回复
热议问题