c# – WCF中的超时问题

前端之家收集整理的这篇文章主要介绍了c# – WCF中的超时问题前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我在WCF中出了问题.

以下是错误

{“请求通道在等待00:00:59.9843744之后等待回复时超时,增加传递给调用请求的超时值或增加绑定中的SendTimeout值,分配给此操作的时间可能是更长的超时“.}

在谷歌搜索后,我找到了解决方

从这个网站

http://social.msdn.microsoft.com/Forums/en-US/peertopeer/thread/38306972-3128-4f0c-937b-5d162d4d8e74

所以我改变了我的app.config文件

<behavior name="ContactServiceBehavIoUr">
  <serviceMetadata httpGetEnabled="true" />
  <dataContractSerializer maxItemsInObjectGraph="1000000000"/>
  <serviceDebug includeExceptionDetailInFaults="true" />
  <serviceThrottling    maxConcurrentCalls="100"
                      maxConcurrentSessions="100"
                      maxConcurrentInstances="100"/>
</behavior>

解决办法是什么?

解决方法

你提到的论坛帖子是一个红色的鲱鱼.错误消息清楚地表明您需要增加WCF客户端和服务中的超时属性. (如果您在服务中更改,我发现客户端更新时并不总是被提取)

在Visual stu@R_403_410@中,转到“工具”菜单,您将找到“WCF服务配置编辑器”.加载您的项目web.config并为您的服务定义一个新的绑定.

要更改的设置是SendTimeout值.默认为60秒.

<system.serviceModel>
<bindings>
  <basicHttpBinding>
    <binding name="WCFBinding" sendTimeout="00:02:00">
    </binding>
  </basicHttpBinding>
</bindings>
原文链接:https://www.f2er.com/csharp/93551.html

猜你在找的C#相关文章