How to increase maxReceivedMessageSize and maxBufferSize parameters in app.config file to 2000000 before running the application.
The currently accepted answer is incorrect. It is NOT required to set maxBufferSize and maxReceivedMessageSize on the client and the server binding. It depends!
If your request is too large (i.e., method parameters of the service operation are memory intensive) set the properties on the server-side, if the response is too large (i.e., the method return value of the service operation is memory intensive) set the values on the client-side.
For the difference between maxBufferSize and maxReceivedMessageSize see MaxBufferSize property?.