開發時發現,在IDE中啓動調試後,只能通過localhost+端口方式訪問,才能成功,並能觸發程序中設置的端點。這在整體調試,客戶端通過IP訪問時非常不方便。苦惱好久。
解決辦法如下:
編輯解決方案目錄下的.\.vs\config\applicationhost.config文件
將<sites>節點下
<site ...>
...
<bindings>
<binding protocol="http" bindingInformation=":8080:*" />
</bindings>
</site>
bindingInformation 中的localhost改爲* 即可。