While working with WCF application I was getting the following error today:
This factory buffers messages, so the message sizes must be in the range of an integer value.Parameter name: bindingElement.MaxReceivedMessageSize
Reason:I was using the following code in my application:
this.MaxReceivedMessageSize = long.MaxValue;
Solution: As the error specifying we need to change the abobe to:
this.MaxReceivedMessageSize = int.MaxValue;
After changing it to int.Max the error was gone.