Asp.net mvc 请求错误-主机名无效-主机文件已修复

Asp.net mvc 请求错误-主机名无效-主机文件已修复,asp.net-mvc,asp.net-mvc-4,Asp.net Mvc,Asp.net Mvc 4,根据其他SO问题,通过编辑hosts文件和applicationhost文件解决了该问题。这两个文件已在我的计算机上正确设置。这个错误在我升级到VisualStudio2015 SP1后立即出现 返回错误的请求 主机文件- 本地主机名解析在DNS本身内处理。 127.0.0.1本地主机 ::1本地主机 127.0.0.1 bdtest.localhost 应用程序主机文件 <site name="BizDox.Web" id="2">

根据其他SO问题,通过编辑hosts文件和applicationhost文件解决了该问题。这两个文件已在我的计算机上正确设置。这个错误在我升级到VisualStudio2015 SP1后立即出现

返回错误的请求

主机文件-

本地主机名解析在DNS本身内处理。 127.0.0.1本地主机 ::1本地主机 127.0.0.1 bdtest.localhost 应用程序主机文件

<site name="BizDox.Web" id="2">
    <application path="/" applicationPool="Clr4ClassicAppPool">
      <virtualDirectory path="/" physicalPath="C:\Source\BizDox\Summer2015-Navigation\BizDox.Web" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:50119:*"/>
      <binding protocol="http" bindingInformation="*:50119:localhost" />
      <binding protocol="http" bindingInformation="*:50119:bdtest.localhost" />
      <binding protocol="http" bindingInformation="*:50119:demo.localhost" />
      <binding protocol="http" bindingInformation="*:50119:diy.localhost" />
      <binding protocol="http" bindingInformation="*:50119:akuity.localhost" />
      <binding protocol="http" bindingInformation="*:50119:owlsfactory.localhost" />
      <binding protocol="http" bindingInformation="*:50119:rtp.localhost" />
      <binding protocol="http" bindingInformation="*:50119:barebones.localhost" />
      <binding protocol="http" bindingInformation="*:50119:sygnet.localhost" />
      <binding protocol="http" bindingInformation="*:50119:firstsolution.localhost" />
    </bindings>
  </site>  

如果主机文件设置正确,还有什么会导致400错误?
我以管理员身份运行VS2015。

VS 2015将mydocuments/iisexpress中的默认applicationhost.config文件更改为特定于项目的applicationhost.config文件。您可以在web项目中的隐藏
.vs
文件夹下找到它

您的两个选项是打开此文件夹并编辑applicationhost.config文件,或者告诉.proj文件使用documents/iisexpress中的默认配置文件。您只需将这一行更改/添加到.proj文件中即可

true

将其添加到
标记内的文件顶部

确保关闭VS并重新打开,以使更改生效。还要确保以管理员身份运行