The maximum message size quota for incoming messages (65536) has been exceeded.

Kurakula, Julia 26 Reputation points
2022-12-08T09:40:42.047+00:00

I am unable to view the dashboard in website. As it shows
"Thread was being aborted.Source: Forms/WebPeopleSearch.aspx - Page_Load. "

So while debugging the WebApp code, I found this in the catch exception:
The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

This is the WCF Web.config:

    <binding name="BasicHttpBinding_XYZService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">  
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"  
        maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>  
    </binding>  
Developer technologies | .NET | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. QiYou-MSFT 4,326 Reputation points Microsoft External Staff
    2022-12-09T07:01:13.473+00:00

    Hi @Kurakula, Julia
    This problem is a relatively common problem in WCF and the solution is as follows:

    <bindings>  
        <basicHttpBinding>  
            <binding name="basicHttp" allowCookies="true"  
                     maxReceivedMessageSize="20000000"   
                     maxBufferSize="20000000"  
                     maxBufferPoolSize="20000000">  
                <readerQuotas maxDepth="32"   
                     maxArrayLength="200000000"  
                     maxStringContentLength="200000000"/>  
            </binding>  
        </basicHttpBinding>  
    </bindings>  
    

    To prevent DOS-type attacks, adjust the value to 20000000.

    Best Regards
    Qi You


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.