vs引用更新wcf mextcpbinding服务错误

我的一个service contract有大概100个方法,host使用的是tcp.ip绑定协议,项目在更新引用服务的时候报错,提示队列不能超过64k。查询了下msdn论坛,找到了解决方法:

 
  
<? xml version="1.0" encoding="utf-8" ?>

< configuration >
< system.serviceModel >
< behaviors >
< serviceBehaviors >
< behavior name ="ServerBehavior" >
< serviceMetadata />
< serviceDebug includeExceptionDetailInFaults ="true" />
</ behavior >
</ serviceBehaviors >
</ behaviors >
< services >
< service name ="SimpleClientServer.HelloService" behaviorConfiguration ="ServerBehavior" >
< host >
< baseAddresses >
< add baseAddress ="net.tcp://localhost:31000/SimpleServer" />
</ baseAddresses >
</ host >
<!-- bindingConfiguration="default" -->
< endpoint address =""
binding
="netTcpBinding"
bindingConfiguration
="myTcp"
contract
="SimpleClientServer.IBigHelloService" />
< endpoint address ="mex"
binding
="netTcpBinding"
bindingConfiguration
="myTcp"
contract
="IMetadataExchange" />
</ service >
</ services >
< bindings >
< netTcpBinding >
< binding name ="myTcp" maxBufferPoolSize ="60000000" maxBufferSize ="60000000" maxReceivedMessageSize ="60000000" >
< readerQuotas maxDepth ="2147483647" maxStringContentLength ="2147483647"
maxArrayLength
="2147483647" maxBytesPerRead ="2147483647" maxNameTableCharCount ="2147483647" />
</ binding >
</ netTcpBinding >
</ bindings >
</ system.serviceModel >
</ configuration >

创建一个新的svcutil.exe.config文件,在本地目录覆盖原有的svcutil.exe.config文件。

 
  
< configuration >

< system.serviceModel >

< client >

<!-- the name should match the required scheme of the Metadata Exchange endpoint

and the contract should be "IMetadataExchange"
-->

< endpoint name ="net.tcp"

binding
="netTcpBinding"

bindingConfiguration
="myTcp"

contract
="IMetadataExchange" />

</ client >

< bindings >

< netTcpBinding >

< binding name ="myTcp" maxBufferPoolSize ="60000000" maxBufferSize ="60000000" maxReceivedMessageSize ="60000000" >

< readerQuotas maxDepth ="2147483647" maxStringContentLength ="2147483647"

maxArrayLength
="2147483647" maxBytesPerRead ="2147483647" maxNameTableCharCount ="2147483647" />

</ binding >

</ netTcpBinding >

</ bindings >

</ system.serviceModel >

</ configuration >


更新引用服务,这下ok啦。

如果是在vs中直接引用wcf服务,当服务的方法超过一定数量后更新服务时候会报错。

2011042611573980.jpg

解决方法很简单,修改devenv.exe.config文件即可:

 
  
< system.net >
< settings >
< ipv6 enabled ="true" />
</ settings >
</ system.net >
  <!--增加system.serviceModel节点-->
< system.serviceModel >
< client >
< endpoint name ="net.tcp" binding ="netTcpBinding" bindingConfiguration ="bindConf" contract ="IMetadataExchange" />
</ client >
< bindings >
< netTcpBinding >
< binding name ="bindConf" maxBufferPoolSize ="2147483647" maxReceivedMessageSize ="2147483647" >
< readerQuotas maxDepth ="2147483647" maxStringContentLength ="2147483647" maxArrayLength ="2147483647" maxBytesPerRead ="2147483647" maxNameTableCharCount ="2147483647" />
< security mode ="None" />
</ binding >
</ netTcpBinding >
</ bindings >
</ system.serviceModel >

参考:http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/d7e36a08-5835-42f8-8eec-8e005cb063c9

转载于:https://www.cnblogs.com/Fred_Xu/archive/2011/04/26/svcutil-throws-error-when-generating-proxy-with-mextcpbinding.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值