今天嘗試利用Android客戶端Web瀏覽器訪問VS2012 IIS Express調試中的Web應用,發現這個IIS Express僅支持localhost主機名地址訪問。html
上網搜索找到解決方案,幾經嘗試最後結果以下:express
在\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虛擬機中作開發,關閉防火牆對安全沒啥影響。)app
或者對防火牆作相應設置,能夠參考下面的網址:post
http://johan.driessen.se/posts/Accessing-an-IIS-Express-site-from-a-remote-computerspa
http://stackoverflow.com/questions/4866547/binding-iis-express-to-an-ip-address調試