I upgraded my ASP.NET MVC project to use Visual Studio, and the nasty Bad Request - Invalid Hostname
error appeared. This problem has been documented in the past for previous versions of Visual Studio (e.g. Using Custom Domains With IIS Express), but I can't seem to find a solution for Visual Studio 2015.
I use many custom domains (e.g. http://foo.testsite.local:1299) to run my site. I run Visual Studio as an administrator and my bindings in applicationhost.config looks like this:
<bindings>
<binding protocol="http" bindingInformation="*:1299:" />
<binding protocol="https" bindingInformation="*:44300:" />
</bindings>
This worked perfectly fine in Visual Studio 2013, but for some reason, running my ASP.NET MVC app in Visual Studio 2015 returns:
HTTP/1.1 400 Bad Request
Bad Request - Invalid Hostname
Any workaround? I need to use wildcards in the bindings instead of hard-coded URLs, because my app supports multiple domain names (including custom subdomains).
I should note that http://localhost:1299
does work with these settings.