当前设置
我们目前正在部署ASP.净核心产品:
- Windows Server 2016
- 托管在IIS版本10.0.14393.0上
我们有一个单一的"站点",下有多个应用程序.每个应用程序使用自己的应用程序池,并映射到不同的物理文件夹路径位置.
每个应用程序都由自己的源代码ASP表示.NET Core Server项目
IIS Structure
问题所在
我们在CI/CD中使用Jenkins,这是无法更改的.我们有Powershell脚本与IIS交互
没有IIS命令来停止应用程序,只有一个站点,但理想情况下,在发布单个应用程序的新版本时,我们不希望关闭该站点.我们只想关闭那个特定的应用程序.
我们试图通过停止与应用程序关联的WebAppPool,然后等待(2分钟..然后5分钟)来实现这一点.但即使在那之后,应用程序文件仍然被锁定.
我们最终关闭了WebAppPool和站点来释放文件,以便替换它们.
I know there has to be a better way to do this. How can we shut down an individual app, and prevent new requests from reaching it so we can replace the files and then restart it? All while the "SITE" and any other App under it not being updated is still running. I don't mind down time for the App being updated.
Update 6/8/2022
找到这个:https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/app-offline?view=aspnetcore-6.0
看看这能不能解决我的问题.