简体   繁体   English

将ASP.NET Core App部署,发布到本地IIS的问题

[英]Deploy,emt issue for ASP.NET Core App to local IIS

I am deploying ASP.NET Core Web API for the first time. 我是第一次部署ASP.NET Core Web API。

I am facing issues and confused on few things. 我面临问题,对某些事情感到困惑。

1) I followed this link Host ASP.NET Core Web API and have no issues until step 5. My Core Web API has Swagger UI and UI not showing up. 1)我遵循了此链接Host ASP.NET Core Web API ,直到第5步都没有问题。我的Core Web API包含Swagger UI和未显示的UI。

2) I followed this link Deploy ASP.NET Core to IIS and in step 3 I am not sure how he gets Add Application. 2)我点击了此链接,将ASP.NET Core部署到IIS ,在步骤3中,我不确定他如何获得“添加应用程序”。 My IIS always show Add website. 我的IIS始终显示“添加网站”。

I followed this link too Host ASP.NET Core on Windows . 我也遵循此链接, 在Windows上托管ASP.NET Core I tried from 2 days haven't get working on IIS. 我尝试从2天开始没有在IIS上工作。

I deployed using Web Deploy and Folder too. 我也使用Web Deploy和Folder进行了部署。 None of them worked 他们都没有工作

This is my Web Config file 这是我的Web配置文件

After Diagnostics, I am here. 诊断后,我在这里。 Runtime doesnot match. 运行时不匹配。 I tried to install from that link and still not working. 我尝试从该链接进行安装,但仍然无法正常工作。

诊断程序

  <?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\\SampleCoreApi.dll" stdoutLogEnabled="false" stdoutLogFile=".\\logs\\stdout" /> </system.webServer> </location> </configuration> 

The first link is talking about hosting the ASP.NET Web API and not ASP.NET Core Web API . 第一个链接是关于托管ASP.NET Web API而不是ASP.NET Core Web API

When you are hosting ASP.NET Core app/api, you need to set the .NET CLR version of the application pool to No Managed Code 承载ASP.NET Core app / api时,需要将应用程序池的.NET CLR版本设置为“ 无托管代码”

在此处输入图片说明

This is also mentioned in the Step 3 of the second link. 第二个链接的步骤3中也提到了这一点。 It's creating an application under the Default Web Site, that's where you see the Add Application option. 它在“默认网站”下创建一个应用程序,您可以在其中看到“ 添加应用程序”选项。 It's not necessary to create an application under the Default Web Site. 无需在“默认网站”下创建应用程序。

在此处输入图片说明

  • You can either create the Application Pool first and set it to No Managed Code . 您可以先创建应用程序池,然后将其设置为“ 无托管代码” Then, when adding a new website, you can select this application pool 然后,在添加新网站时,您可以选择此应用程序池
  • Or, add a new website first. 或者,首先添加一个新网站。 That will create an application pool automatically with the same name as the web site. 这将自动创建一个与网站同名的应用程序池。 Then, you edit the application pool and set it to No Managed Code 然后,您编辑应用程序池并将其设置为“ 无托管代码”

在此处输入图片说明

I hope that helps. 希望对您有所帮助。

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

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