How can application lifetime be controlled for ASP.NET hosted runtime?

I am hosting the ASP.NET runtime in code that runs as a windows service and I am trying to figure out what the best way to keep the application I am hosting in it from unloading when a period of inactivity occurs.

I see that the HostingEnvironment class has methods to increment and decrement BusyCounts. If I increment the busy count will that effectvely keep my application from unloading The documentation states

"If the busy count is greater than zero, the hosting application will not time out even if there are no pending requests."

I am not sure if the docs were meant to say "the hosted application" rather than "the hosting application".

Is this going to do what I hope it will do Is there another way to do this without having a separate thread and timer to periodically hit a url in the app

One last question. I have yet to find a way to force an applicaiton to start without making a request. Surely there is a way to do this. Is there



Answer this question

How can application lifetime be controlled for ASP.NET hosted runtime?

  • jcooper

    Hi!

    I don't know the answer to this question, but know that the people who own this for the ASP.NET team read the ASP.NET forums.

    The best place for asking ASP.NET questions is on the ASP.NET community site, and in the forums there. Check out http://www.asp.net/welcome.aspx tabindex=1&tabid=39.

    HTH,

    PEte



  • How can application lifetime be controlled for ASP.NET hosted runtime?