I have a test ASP.NET MVC3 application developed in VS2012. When I start debugging the app is accessed from the host machine via the request to
HTTP error 400: Bad request. Invalid Host Name.
I made a video that better describes the process, https://youtu.be/5ZqDuvTqQVs
If you are using VS2013, make sure you run it as an administrator for this to work.
%USERPROFILE%\My Documents\IISExpress\config\applicationhost.configfile. Inside you should see something like this:
<site name="WebSite1" id="1" serverAutoStart="true"> <application path="/"> <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" /> </application> <bindings> <binding protocol="http" bindingInformation="*:8080:localhost" /> </bindings> </site>
bindingInformation="*:8080:*" (the port number, 8080 in my case, will differ.)
Then make sure your firewall is allowing incoming connections on that port. You may need to restart the system or at least Visual Studios to get IISExpress to reload the config file.
If this doesn't work, take a look at this answer: http://stackoverflow.com/a/5186680/985284