title: Bad Request - Invalid Hostname - Host files already fixed
body: <p>According to other SO questions the problem has been solved by editing the hosts file and applicationhost file. These two files are already properly setup on my machine. This error started ocurrring right after I upgraded to visual studio 2015 SP1</p>
  <p><a href="http://bdtest.localhost:50119/" rel="nofollow noreferrer">http://bdtest.localhost:50119/</a> returns bad request</p>
  <p>Hosts File -</p>
  <h1>localhost name resolution is handled within DNS itself.</h1>
  <h1>127.0.0.1       localhost</h1>
  <h1>::1             localhost</h1>
  <h1>127.0.0.1       bdtest.localhost</h1>
  <p>application hosts file</p>
  <pre><code>&lt;site name=&quot;BizDox.Web&quot; id=&quot;2&quot;&gt;
      &lt;application path=&quot;/&quot; applicationPool=&quot;Clr4ClassicAppPool&quot;&gt;
        &lt;virtualDirectory path=&quot;/&quot; physicalPath=&quot;C:\Source\BizDox\Summer2015-Navigation\BizDox.Web&quot; /&gt;
      &lt;/application&gt;
      &lt;bindings&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:*&quot;/&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:bdtest.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:demo.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:diy.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:akuity.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:owlsfactory.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:rtp.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:barebones.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:sygnet.localhost&quot; /&gt;
        &lt;binding protocol=&quot;http&quot; bindingInformation=&quot;*:50119:firstsolution.localhost&quot; /&gt;
      &lt;/bindings&gt;
    &lt;/site&gt;  
  </code></pre>
  <h1>What else could cause a 400 error if your host files are properly setup?</h1>
  <p>I am running VS2015 as admin.</p>