Welcome

首页 / 软件开发 / WCF / WCF分布式开发常见错误解决(1)

WCF分布式开发常见错误解决(1)2011-03-31 博客园 Frank Xu LeiWCF分布式开发常见错误解决(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服务引用。就可以成功。