使IIS Express支持其他网络客户端访问

今天尝试利用Android客户端Web浏览器访问VS2012 IIS Express调试中的Web应用,发现这个IIS Express仅支持localhost主机名地址访问。

上网搜索找到解决方案,几经尝试最后结果如下:

在\Users\YourName\My Documents\IISExpress\config\applicationhost.config文件中找到正在调试的Web应用的设置行:

            <site name="HengShen.Pts.Web" id="2">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\Users\VMUser\Documents\Visual Studio 2012\Projects\PtsSolution\HengShen.Pts.Web" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:40000:localhost" />
                </bindings>
            </site>

将倒数3行的localhost删掉,冒号要保留。

然后,关闭这台电脑的防火墙(我是在VMWare Fusion虚拟机中做开发,关闭防火墙对安全没啥影响。)

或者对防火墙做相应设置,可以参考下面的网址:

http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computer

http://stackoverflow.com/questions/4866547/binding-iis-express-to-an-ip-address

 

posted on 2014-01-09 17:15  jlzhou  阅读(2663)  评论(0编辑  收藏  举报

导航