使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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM