How to auto start and keep an ASP.NET core web application running on IIS

Tai Bo
4 min readOct 7, 2018

I have an ASP.NET core web application which hosts a background task via the IHosedService interface. The task needs to run continuously to poll for messages on an azure queue storage every 5 seconds. I have learned the default settings on IIS do not start the application until it receives the first request. Additionally, if the application has not received a request after a predefined period of time, IIS kills the application.

I could have hosted the application as a Windows service or converted the…

--

--

Tai Bo

Backend developer in .NET core. I enjoy the outdoor, hanging out with good friends, reading and personal development.