您的位置:首页 > 其它

WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错

2015-07-10 10:59 766 查看
WCF分布式开发常见错误解决(1):An error occurred while attempting to find services at...添加服务引用出错

  当我们在客户端添加WCF服务引用的时候出错,信息如下

  下载“http://localhost:8001/WCFService”时出错。

  无法连接到远程服务器

  由于目标机器积极拒绝,无法连接。 127.0.0.1:8001

  Metadata contains a reference that cannot be resolved: 'http://localhost:8001/WCFService'.

  Could not connect to http://localhost:8001/WCFService. TCP error code 10061: 由于目标机器积极拒绝,无法连接。 127.0.0.1:8001.

  无法连接到远程服务器

  由于目标机器积极拒绝,无法连接。 127.0.0.1:8001

  If the service is defined in the current solution, try building the solution and adding the service reference again.



  解决办法:

  1.查看防火墙设置。有没有打开服务端口,比如8001,没有的话添加服务端口为安全端口;

  2.检查服务托管进程是否启动,这个情况一般是针对自定义宿主来托管服务的情况,运行服务托管程序。

  重新添加WCF服务引用。就可以成功。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: