WcF生成客户端遇到的问题/
我建立的WCF服务器端程序,用svcutil命令一直就生成不了客户
提示错误:
元数据包含无法解析的引用:"net.tcp://127.0.0.1:6987/do"
没有终结点在侦听可以接受消息的net.tcp://127.0.0.1:6987/do
解决法办1:
在程序中添加如下代码
if (host.Description.Behaviors.Find<System.ServiceModel.Description.ServiceMetadataBehavior>() == null)
{
BindingElement elemnt = new TcpTransportBindingElement();
CustomBinding bind = new CustomBinding(elemnt);
host.Description.Behaviors.Add(new System.ServiceModel.Description.ServiceMetadataBehavior());
host.AddServiceEndpoint(typeof(System.ServiceModel.Description.IMetadataExchange), bind, "Mex");
}
解决办法2
服务端配置文件做如何更改如下&#x