Allow remote access to IISExpress for development in VS

When you want to test your website and check it remote you see the error:

Bad Request – Invalid Hostname


HTTP Error 400. The request hostname is invalid.

First thing to do is to find the correct applicationhost.config file. This file can be found in

the solution directory under .vs/<Solution name>/config. This file contains an entry under the tag <sites> for the site with the config that is applied in IISExpress.

This enables binding for the IIS:

    <bindings>
      <binding protocol="http" bindingInformation="*:29136:localhost" />
      <binding protocol="https" bindingInformation="*:44343:localhost" />
    </bindings>

Above configuration only allows localhost to access the IISSExpress site.

Change it to:
        <bindings>
          <binding protocol="http" bindingInformation=":29136:" />
          <binding protocol="https" bindingInformation=":44343:" />
        </bindings>
to allow remote machines to access the site.