Search code examples
c#.netwinformswcfservice-model

maxReceivedMessageSize and maxBufferSize in app.config


How to increase maxReceivedMessageSize and maxBufferSize parameters in app.config file to 2000000 before running the application.


Solution

  • You need to do that on your binding, but you'll need to do it on both Client and Server. Something like:

    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding maxBufferSize="64000000" maxReceivedMessageSize="64000000" />
            </basicHttpBinding>
        </bindings>
    </system.serviceModel>