Home > database >  Keep .NET 5 Web API running all the time in IIS
Keep .NET 5 Web API running all the time in IIS

Time:10-29

I have .Net 5 Web API hosted on IIS 10.

I configured IIS Application pool and IIS Site as mentioned here.

  1. Install server feature - Application Initialization Module
  2. Set the Start Mode to AlwaysRunning
  3. Set Preload Enabled to True
  4. Set the Idle Time-out (minutes) to 0 (zero)

The problem is - When I reset IIS(iisreset), app is not initializing. I see only app is shutdown in logs.

2021-10-26 16:35:16.5366|INFO|Microsoft.Hosting.Lifetime|Application is shutting down... 2021-10-26 16:35:16.5366|INFO|Quartz.Core.QuartzScheduler|Scheduler QuartzScheduler_$_NON_CLUSTERED shutting down.

What am I missing?

CodePudding user response:

Finally I figured out that for "Preload" = true on the Web Site to work you should activate anonymous authentication on the web site.

If anyone knows how to fix this for Windows Authentication only, please add your answer.

  • Related