问题
I have an azure worker role which is medium size and one instance. I encountered an error which says "The maximum message size quota for incoming messages (1048576) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element." when deploying my azure worker role cloud service to azure using visual studio.
I tried to increase maxReceivedMessageSize property in app.config like this but it didn't work:
<bindings>
<basicHttpBinding>
<binding name="basicHttp" allowCookies="true"
maxReceivedMessageSize="2147483648"
maxBufferSize="2147483648"
maxBufferPoolSize="2147483648">
<readerQuotas maxDepth="32"
maxArrayLength="2147483648"
maxStringContentLength="2147483648"/>
</binding>
</basicHttpBinding>
</bindings>
Please help me to solve this problem.
Thanks in advance.
回答1:
The highest permittable number for the max* numbers is 2147483647, not 2147483648 which you have listed. Your config should look like this:
<bindings>
<basicHttpBinding>
<binding name="basicHttp" allowCookies="true"
maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647"
maxBufferPoolSize="2147483647">
<readerQuotas maxDepth="32"
maxArrayLength="2147483647"
maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
回答2:
I am having the exact problem. Apparently, it is a problem with Azure itself (see: https://social.msdn.microsoft.com/Forums/en-US/6b895c6b-69e3-4211-ab2f-29b95ff23030/unable-to-publish-web-role-maxreceivedmessagesize-error?forum=windowsazuredevelopment).
The problem was marked as fixed in the link above. However, today, I am still getting the exact same problem. I had to upload the package manually :(
Cheers
来源:https://stackoverflow.com/questions/32454252/how-to-increase-maxreceivedmessagesize-for-azure-worker-role-deployment