简体   繁体   English

如何在IIS中运行.Net MVC(与使用`dotnet run`进行本地测试相比)

[英]How to run .Net MVC in IIS (vs using `dotnet run` for testing locally)

So this is a C#-based .Net WebApp for a client on an Azure deployment on their network. 因此,这是一个基于C#的.Net WebApp,用于网络上Azure部署上的客户端。

Testing locally, I can do dotnet run and test on http://localhost:5000 fine, but in the final environment, it'll need to be served by IIS. 在本地进行测试,我可以在http://localhost:5000上进行dotnet run和测试,但是在最终环境中,它将需要由IIS提供服务。 I believe dotnet run (Kestrel) and IIS have a way of talking to each other (there is a method called something like .useIISIntegration I believe). 我相信dotnet run (Kestrel)和IIS有一种相互交谈的方式(我相信有一种名为.useIISIntegration的方法)。

But I'd like to skip any deployment script that requires I dotnet run to start the application if possible, but let IIS handle all of that. 但是我想跳过所有需要我dotnet run才能启动应用程序的部署脚本,但是让IIS处理所有这些。 Once deployed, is dotnet run absolutely necessary? 部署后, dotnet run绝对必要dotnet run How does IIS handle it directly, if possible? 如果可能的话,IIS如何直接处理它?

I guess that for your purpose you can simply: 我想出于您的目的,您可以:

  • run dotnet publish 运行dotnet发布
  • create an application in IIS against the program 在IIS中针对该程序创建一个应用程序
  • create an application pool and start it. 创建一个应用程序池并启动它。

Don't forget to install the SDK/Hosting bundle in the destination server otherwise IIS will not be able to run it. 不要忘记在目标服务器中安装SDK / Hosting捆绑包,否则IIS将无法运行它。

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

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