Raf
Raf

Reputation: 235

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

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?

Upvotes: 2

Views: 1405

Answers (1)

Raf
Raf

Reputation: 235

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.

Upvotes: 1

Related Questions