title: WCF MaxItemsInObjectGraph setting not working
body: <p>I have been getting the following error trying to access my WCF service. </p>
  
  <blockquote>
    <p>'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota</p>
  </blockquote>
  
  <p>Doing some research, it looks like all I need to do is update this setting to be a higher value. This is what I am trying to do, but the setting does not seem to be getting read from the configuration. I keep getting the same exception with the 65536 value in it. </p>
  
  <p>I followed the instructions found at this <a href="http://www.dailycode.info/Blog/post/2011/05/27/Change-the-object-graph-or-increase-the-MaxItemsInObjectGraph-quota.aspx" rel="noreferrer">Link</a>, but am having no luck. </p>
  
  <p>Here is what I have configured on the WCF Service's Web.Config. </p>
  
  <pre><code>    &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="metadataBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="true"  httpGetUrl="" /&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
                  &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
  </code></pre>
  
  <p>This is what is in the Client's app.config: </p>
  
  <pre><code>        &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior&gt;
                  &lt;serviceMetadata httpGetEnabled="True" /&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
          &lt;endpointBehaviors&gt;
              &lt;behavior &gt;
                  &lt;dataContractSerializer maxItemsInObjectGraph="2147483646"/&gt;
              &lt;/behavior&gt;
          &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
  </code></pre>
  
  <p>And lastly, I have the following attribute on the WCF service itself: </p>
  
  <pre><code>[ServiceBehavior(MaxItemsInObjectGraph = 2147483646, IncludeExceptionDetailInFaults = true)]
  </code></pre>
  
  <p>Despite the configurations above, I still get an Exception complaining about the 65536 value. Why aren't any of these settings being used by the applications? Is there something else that needs to be set somewhere? </p>