Thursday, September 24, 2009

Passing Large Arrays (Lists) Via WCF

Was getting the error "The underlying connection was closed: The connection was closed unexpectedly" when passing arrays from large datasets to the client.

This is the solution:

Basically requires adding the following to both the server and the client config files (web.config / app.config)

<dataContractSerializer maxItemsInObjectGraph="2147483646"/>