【发布时间】:2019-06-14 15:48:13
【问题描述】:
这个问题是关于在 IIS 上运行的 ASP.NET Core 2.2 应用程序,特别是在向 DI 容器注册 IHostedService 的实例时。
我读到的每一篇关于IHostedService.StopAsync() 的文章都只是谈到了StopAsync() 在主机“关闭”时被调用,但我想知道当 IIS 回收时会发生什么。
我的问题:
1. IIS 回收时是否调用了StopAsync()?
2。无论使用InProcess 托管还是OutOfProcess 托管,答案是否相同?(ASP.NET Core 从版本 2.2 开始支持InProcess)
【问题讨论】:
标签: iis dependency-injection asp.net-core-2.2 asp.net-core-hosted-services