Home > Development > WCF Returning Large Data Contract Collections Gotcha

WCF Returning Large Data Contract Collections Gotcha


Just a quick thing to add on this topic is that you need to adjust the DataContractSerializer Settings to allow it to return Large Collections of Dtos. You need to add the following to your service behaviour on both the client and the server.

<?xml version="1.0"?>
<dataContractSerializer maxItemsInObjectGraph="10000000"/>

Remember the following to calculate the value. Number = number of items in collection * number of properties in item + 1 for the list object itself.

This took me ages to get right.

Hope it helps you.

Blair….

Advertisements
Categories: Development Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: