简体   繁体   中英

.Net 5.0 Web API deployment issue on IIS

I am having issues with .net core web api deployments on IIS.

  • I have created the simple web api project using .net core 5. This opens up correctly while running through VS 2019.

  • I have installed the .net core 5.0.2 hosting bundle on my machine. 在此处输入图像描述

  • 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.

After following all these required steps i am not able to browse through the published APIs using localhost. but it shows some weird errors like HTTP Error 404.0 - Not Found

在此处输入图像描述

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:

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

Or you could try

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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