


Install the Application Initialization Module Keeping the app to run continuously on IISĭo the following to keep an ASP.NET core application auto start and always run on IIS: I. This lazy loading feature is by design to efficiently manage resources. This is essentially the same behavior as seen with ASP.NET 4.x apps that run in-process in IIS that are managed by the Windows Process Activation Service (WAS)Īs the behavior of an ASP.NET core module is similar to the WAS, the module also terminates the application it has not received a HTTP request for the application after a predefined period of time (Idle time-out).

The module starts the process for the ASP.NET Core app when the first request arrives and restarts the app if it crashes. Per the documentation, the module does not start the process for the ASP.NET core app until it receives an initial HTTP request. The ASP.NET core module handles requests for an ASP.NET core application and manages the process under which the application runs. If you have an ASP.NET or an ASP.NET core which hosts a background job that needs to always run, want to preload the application for performance instead of waiting for the initial request to hit the app, or just get some tips on IIS, then read on.Īpplication does not auto start and goes into idle In this post, I share how I make the application to auto start and always run on IIS. However, I find hosting on a real IIS server convenient and beneficial since we already have other applications running on IIS and we can access the application via HTTP. I could have hosted the application as a Windows service or converted the application into a console application and use the Windows scheduler to have it run continuously. Additionally, if the application has not received a request after a predefined period of time, IIS kills the application. I have learned the default settings on IIS do not start the application until it receives the first request. The task needs to run continuously to poll for messages on an azure queue storage every 5 seconds. I wrote about it in this post, if you want more info. I have an ASP.NET core web application which hosts a background task via the IHosedService interface.
