多種可能性我看
默認路由是這樣的基礎上您的routing .Could您瀏覽到
http://testweb.sherrygreengrp.com/api/<controller>
Install the .NET Core Windows Server Hosting bundle on the hosting system. The bundle will install the .NET Core Runtime, .NET Core Library, and the ASP.NET Core Module. The module creates the reverse-proxy between IIS and the Kestrel server. Note: If the system doesn't have an Internet connection, obtain and install the Microsoft Visual C++ 2015 Redistributable before installing the .NET Core Windows Server Hosting bundle
ASP.NET CORE Module配置正確。做你在你的web.config有此設置
<?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> </system.webServer> </configuration>
好吧,這很有趣。最初有一個web.config下載非常類似於你在這裏發佈的。但是這阻止了我從IIS瀏覽項目,所以我將它重命名爲webx.configx,然後我就可以。根據你的建議,我將它重新命名爲web.config,當我啓動它時,我得到「無法找到該網頁」。在Postman中,當我撥打電話時,我得到一個404,當我啓動使用web api的web項目時,我得到「沒有連接,因爲目標機器主動拒絕它」 – arame3333
這可能是Web API項目是核心項目,而其他使用的項目不是核心項目。 – arame3333
「此網頁無法找到」基本上是404,這是因爲AspNetCoreModule沒有正確連接。是否按照[在此]提到的所有步驟操作(https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/servers/aspnet-core-module) –