简体   繁体   English

.Net 5.0 Web API IIS 部署问题

[英].Net 5.0 Web API deployment issue on IIS

I am having issues with .net core web api deployments on IIS.我在 Z5DA5ACF461B4EFB27E76EC86106Z 上的 .net 核心 web api 部署遇到问题。

  • I have created the simple web api project using .net core 5. This opens up correctly while running through VS 2019.我使用 .net 核心 5 创建了简单的 web api 项目。这在运行 VS 2019 时可以正确打开。

  • I have installed the .net core 5.0.2 hosting bundle on my machine.我已经在我的机器上安装了 .net 核心 5.0.2 托管包。 在此处输入图像描述

  • Created the application pool with the "No Managed Code" settings.使用“无托管代码”设置创建了应用程序池。 在此处输入图像描述

  • Published the API using vs folder published and created the IIS site that points to the published folder.使用已发布的 vs 文件夹发布 API 并创建指向已发布文件夹的 IIS 站点。

After following all these required steps i am not able to browse through the published APIs using localhost.完成所有这些必需步骤后,我无法使用 localhost 浏览已发布的 API。 but it shows some weird errors like HTTP Error 404.0 - Not Found但它显示了一些奇怪的错误,例如 HTTP 错误 404.0 - 未找到

在此处输入图像描述

Please make sure the necessary feature like static content and asp.net feature in turn windows features on or off/add role and feature->internet information service->world wide web service->application development feature->asp.net has been enabled. Please make sure the necessary feature like static content and asp.net feature in turn windows features on or off/add role and feature->internet information service->world wide web service->application development feature->asp.net has been enabled.

In addition, you could try to add runAllManagedModulesForAllRequests="true" attribute to your module section just like:此外,您可以尝试将runAllManagedModulesForAllRequests="true"属性添加到您的模块部分,就像:

<system.webServer>
  <modules runAllManagedModulesForAllRequests="true" >    
  </modules>
</system.webServer>

Or you could try或者你可以试试

<system.webServer>
 <modules runAllManagedModulesForAllRequests="true" >
   <remove name="UrlRoutingModule"/>    
 </modules>
</system.webServer>

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

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