【发布时间】:2017-01-17 01:10:47
【问题描述】:
我使用 web api 创建了一个 .Net 项目 4.6。
为了简单起见,我在父目录中创建了 default.htm。我将我的项目发布到 localhost,并根据屏幕截图将默认文档设置为 default.htm:
已发布 web.config:
<system.web>
<authentication mode="None" />
<compilation targetFramework="4.6" />
<httpRuntime targetFramework="4.5.2" />
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
</httpModules>
<customErrors mode="Off" />
</system.web>
<system.webServer>
<modules>
<remove name="FormsAuthentication" />
<remove name="ApplicationInsightsWebTracking" />
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" />
</modules>
<handlers>
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
<remove name="OPTIONSVerbHandler" />
<remove name="TRACEVerbHandler" />
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
但是,每当我导航到 http://localhost/ 时,它总是按照下面的屏幕截图返回 404:有人可以帮忙吗?谢谢
【问题讨论】:
标签: asp.net iis asp.net-web-api