Setting localhost alias in IIS Express for Visual Studio

独自空忆成欢 提交于 2019-12-04 02:29:56
erdomke

Since the linked URL from Jack's answer is currently not working, and the solution (at least for me) was covered in the answer to another question, I will repeat the answer here:

You can have multiple bindings set. Therefore, you can setup bindings for every external address you wish to serve on, and it will work:

<bindings>
    <binding protocol="http" bindingInformation=":1904:" />
    <binding protocol="http" bindingInformation=":1904:machineName" />
    <binding protocol="http" bindingInformation=":1904:10.1.10.123" />
</bindings>
D.Rosado

If you reach this page looking for a solution for VS2015+, the applicationhost.config file you are looking for is no longer on documents\IISExpress\config.

The new location is {solutiondir}\.vs\config\applicationhost.config.

Jack

I encountered a similar error here, and it turned out that the solution could be found at: http://stonycreektechnologies.com/2011/03/15/iis-express-enable-remote-requests/

For me, this was just a case of running the command there (I used it for port 8080 and for the port for my project, 55968, just to be sure) and closing and reopening my project, editing my applicaitonhost.config file, and then changing the settings of the site through the visual studio gui.

The other thing to be careful of is that you may get multiple entries for your port number in the applicationhost.config file. This is bad, you only want the one, so you're safe to cull off the other entries with the same port.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!