简体   繁体   English

将 ASP.NET Core 应用程序部署到 IIS

[英]Deploy ASP.NET Core application to IIS

There are a lot of articles all over the Internet about deploying of .NET Core applications to IIS server, but i still can not find clear answers to the following questions:互联网上有很多关于将.NET Core应用程序部署到IIS服务器的文章,但我仍然找不到以下问题的明确答案:

  • What is the lifetime of dotnet.exe process running behind of IIS?在 IIS 后面运行的 dotnet.exe 进程的生命周期是多少? I guess that in contrast to "classic" IIS managed pools, dotnet process will not be stopped after some idle period.我想与“经典”的 IIS 管理池相比,dotnet 进程在一段时间后不会停止。
  • Right now i can not reupload a running application because some files are being used by dotnet.exe process.现在我无法重新上传正在运行的应用程序,因为 dotnet.exe 进程正在使用某些文件。 How to resolve this issue?如何解决这个问题? I can not simply kill this process when i have several .NET Core applications running on the same server...Yes, i know that running each website in container can solve this issue, but i don't have Docker on my Windows Server machine and i had read several articles where people say that running Docker on Windows is some kind of moveton.当我在同一台服务器上运行多个 .NET Core 应用程序时,我不能简单地终止这个进程......是的,我知道在容器中运行每个网站可以解决这个问题,但我的 Windows Server 机器上没有 Docker我读过几篇文章,其中有人说在 Windows 上运行 Docker 是一种移动。
  • Does dotnet publish command support MS Deploy publishing? dotnet publish命令是否支持 MS Deploy 发布? There are some plugins available on VSTS for such publishing, but i want to have an ability to do the same thing from my Visual Studio. VSTS 上有一些插件可用于此类发布,但我希望能够从我的 Visual Studio 中执行相同的操作。 There are also a lot of tutorials about publishing, but all such tutorials shows how to publish a website to the local folder, not the remote server.还有很多关于发布的教程,但所有这些教程都展示了如何将网站发布到本地文件夹,而不是远程服务器。

Thanks.谢谢。

It's not managed code , which is to say that IIS is not loading a module to run it as it would with a traditional ASP.NET application, but the lifetime is still tied to the app pool like any other website hosted by IIS.它不是托管代码,也就是说 IIS 不会像使用传统的 ASP.NET 应用程序那样加载模块来运行它,但是生命周期仍然像 IIS 托管的任何其他网站一样与应用程序池相关联。 Long and short, configure the app pool how you want it.总而言之,根据您的需要配置应用程序池。

Again, the app pool is what matters in terms of starting and stopping.同样,应用程序池在启动和停止方面很重要。 Each of your Core apps should be running in their own app pools, which then means you can independently start/stop each one on their own.您的每个 Core 应用程序都应该在自己的应用程序池中运行,这意味着您可以独立启动/停止每个应用程序。

Yes, you can still use Web Deploy.是的,您仍然可以使用 Web 部署。 Deployment is really totally separate from what is being deployed.部署实际上与正在部署的内容完全分开。 The initial configuration of the site in IIS and the actual build that happens during publish takes care of all the Core-specific differences. IIS 中站点的初始配置和发布期间发生的实际构建处理所有特定于 Core 的差异。 Web Deploy is just moving files. Web 部署只是移动文件。

I don't believe I'm an expert on this issue, but I can share my experiences hosting .net core web api behind IIS.我不相信我是这个问题的专家,但我可以分享我在 IIS 后面托管 .net core web api 的经验。

OT, Compared to Kestrel, my app (and all my POC apps) gets ~40% more rps when hosted on IIS. OT,与 Kestrel 相比,我的应用程序(以及我所有的 POC 应用程序)在 IIS 上托管时获得了大约 40% 的 rps。

  • I use some variant of active/active, and no, the app's lifetime has nothing to do with idle periods我使用了 active/active 的一些变体,不,应用程序的生命周期与空闲时间无关
  • Due to my setup, I never have to worry about this issue, however I don't see a way around not restarting services由于我的设置,我从不必担心这个问题,但是我看不到不重启服务的方法
  • Deploying via .net core cli tools is actually quite easy and robust.通过 .net core cli 工具进行部署实际上非常简单和强大。 Since you're not dockerizing, adding a bit of powershell remoting/invokebuild, could really provide you with all the deployment automation you would ever need.由于您不是 dockerizing,因此添加一些 powershell 远程处理/invokebuild,确实可以为您提供您需要的所有部署自动化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM