wcf服务设置让别人可以挂接

vs调试 wcf服务启动之后一般都是使用 IisExpress作为Web服务器,是locahost ,这样其他人是无法连接 vs启动的wcf服务,可以通过设置配置文件,使局域网内其他电脑可以访问本机的wcf服务,具体如下

<bindings>
<binding protocol="http" bindingInformation="*:3476:localhost" />
<binding protocol="http" bindingInformation="*:3476:192.168.1.242" />    //添加这个 
</bindings>

以上,配置完之后,重启服务。注意要以管理员身份运行、注意要关闭防火墙,否则,其他电脑还是无法连接wcf服务

猜你喜欢

转载自www.cnblogs.com/dlzh/p/12155661.html