在 IIS 中始终保持 .NET 5 Web API 运行

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

我在 IIS 10 上托管了 .Net 5 Web API。

我如前所述配置了 IIS 应用程序池和 IIS 站点 here

  1. 安装服务器功能 - 应用程序初始化模块
  2. 将启动模式设置为 AlwaysRunning
  3. 将启用预加载设置为 True
  4. 将空闲超时(分钟)设置为 0(零)

问题是 - 当我重置 IIS (iisreset) 时,应用程序没有初始化。我在日志中看到只有应用程序已关闭。

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.

我错过了什么?

最后我发现要使网站上的“Preload”= true 正常工作,您应该在网站上激活匿名身份验证

如果有人知道如何仅针对 Windows 身份验证解决此问题,请添加您的答案。