c# – “已超出传入邮件的最大邮件大小配额(65536).”即使设定了更大的尺寸

前端之家收集整理的这篇文章主要介绍了c# – “已超出传入邮件的最大邮件大小配额(65536).”即使设定了更大的尺寸前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图从 Windows窗体客户端应用程序访问WCF服务.我在服务器上的绑定配置是这样的:
<bindings>
      <customBinding>
        <binding name="Wrabind" closeTimeout="00:05:00" openTimeout="00:05:00"
            sendTimeout="00:25:00">
          <textMessageEncoding />
          <security authenticationMode="SecureConversation" includeTimestamp="true"
              messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <localClientSettings maxClockSkew="00:30:00" />
            <localServiceSettings maxClockSkew="00:30:00" />
            <secureConversationBootstrap messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
              <localClientSettings maxClockSkew="00:30:00" />
              <localServiceSettings maxClockSkew="00:30:00" />
            </secureConversationBootstrap>
          </security>
          <httpTransport maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000"
              allowCookies="true" maxBufferSize="20000000" />
        </binding>
      </customBinding>
    </bindings>

如您所见,我已将maxReceivedMessageSize设置为20000000,但仍显示“已超出传入邮件的最大邮件大小配额(65536)”.例外.我错过了什么吗?

解决方法

也许这个错误来自客户端而不是服务器.确保客户端配置中存在相同的设置.
原文链接:https://www.f2er.com/csharp/243469.html

猜你在找的C#相关文章