title: WCF MaxArrayLength Changing Setting Won't Stay
body: <p>I am trying to upload files using WCF.  Everything under 16K works fine, but anything over throws this error:</p>
  
  <p>There was an error deserializing the object of type System.Byte[]. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader</p>
  
  <p>This is my WCF Service app.config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  
    &lt;system.web&gt;
      &lt;compilation debug="true" /&gt;
    &lt;/system.web&gt;
    &lt;!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="WSHttpBinding_IRAISAPI" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="104857600"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" /&gt;
            &lt;security mode="Message"&gt;
              &lt;transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" /&gt;
              &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="RAIS_WCF_Services.RAISAPI"&gt;
          &lt;endpoint address="" binding="wsHttpBinding" contract="RAIS_WCF_Services.IRAISAPI"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:8732/Design_Time_Addresses/RAIS_WCF_Services/Service1/" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;serviceMetadata httpGetEnabled="True"/&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="True" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>and here is my client app.config</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client" /&gt;
    &lt;/startup&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="WSHttpBinding_IRAISAPI" closeTimeout="00:01:00"
            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
            bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
            maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"
            messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
            allowCookies="false"&gt;
            &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="104857600"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
            &lt;reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" /&gt;
            &lt;security mode="Message"&gt;
              &lt;transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" /&gt;
              &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"
                algorithmSuite="Default" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="http://localhost:8732/Design_Time_Addresses/RAIS_WCF_Services/Service1/"
          binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IRAISAPI"
          contract="RAIS.IRAISAPI" name="WSHttpBinding_IRAISAPI"&gt;
          &lt;identity&gt;
            &lt;dns value="localhost" /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Any help is much appreciated!  Thanks.</p>