40

I noticed that 2147483647 seems to be a popular choice for maxReceivedMessageSize but is this the limit?

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501
Nick
  • 3,217
  • 5
  • 30
  • 42
  • 4
    On the other hand, you might want to consider that setting it to 2 GB of message size means your WCF server will potentially have to deal with several messages of up to 2 GB in size simultaneously - can it do that?? Marc – marc_s Jun 17 '09 at 04:49
  • 1
    It is if you have a 32bit server... – Chad Aug 10 '17 at 18:50

3 Answers3

43

Nope, the limit is Int64.MaxValue1 which is: 9223372036854775807

Robert MacLean
  • 38,975
  • 25
  • 98
  • 152
AgileJon
  • 53,070
  • 5
  • 41
  • 38
9

MaxMessageReceivedSize in basicHttpBinding appears to be an int32 - setting it over the max value of an int32 results in:

This factory buffers messages, so the message sizes must be in the range of an integer value. Parameter name: bindingElement.MaxReceivedMessageSize

AndySw
  • 341
  • 2
  • 7
  • Nope, it's Int64 (long): http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxreceivedmessagesize%28v=vs.100%29.ASPX – Darren Griffith Jun 11 '14 at 17:45
3

MaxReceivedMessageSize and MaxBufferSize must same value and MaxBufferSize is Int32.

Muhammad Hani
  • 8,476
  • 5
  • 29
  • 44
fernando
  • 67
  • 3
  • 10
    Not true - MaxBufferSize is only used if you are using Buffering. If you are using Streaming, then it is ignored. This is why MaxReceivedMessageSize is Int64 and can be different to MaxBufferSize. – Robert MacLean Feb 26 '13 at 10:44
  • Do you mean maxBufferPoolSize and maxReceivedMessageSize? – Gary Dec 10 '13 at 19:55
  • BasicHttpBinding MaxBufferSize is Int32, but MaxReceivedMessageSize is Int64. http://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.maxbuffersize%28v=vs.100%29.aspx – Darren Griffith Jun 11 '14 at 17:47