【问题标题】:Default landing page asp.net web api published IIS默认登陆页面 asp.net web api 发布 IIS
【发布时间】: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:有人可以帮忙吗?谢谢

我正在使用端口 80:

【问题讨论】:

    标签: asp.net iis asp.net-web-api


    【解决方案1】:

    所有在 IIS 中发布的网站都需要有这样的端口:

    1.Assuming you are using the port of 8462.
    2.Try to navigate this url =  localhost:8462
    

    确保您的 asp.net 已像这样aspnet_regiis -i 注册到您的 IIS

    祝你好运!

    【讨论】:

      猜你喜欢
      • 2016-02-26
      • 1970-01-01
      • 2011-07-30
      • 2018-03-04
      • 2020-05-25
      • 1970-01-01
      • 2012-03-18
      • 2017-08-18
      • 1970-01-01
      相关资源
      最近更新 更多