WCF Error "El número máximo de elementos que se pueden serializar o deserializar en un gráfico de objeto es '65536'"

Recibo el siguiente error en una llamada de WCF:

l número máximo de elementos que se pueden serializar o deserializar en un gráfico de objeto es '65536'

He leído un montón de publicaciones en el foro y muchas de ellas mencionan la modificación de app.config y web.config para especificar un nuevo comportamiento para permitir gráficos de objetos más grandes. Lo he hecho y esto es lo que tengo en esos archivos:

App.Config en el proyecto WPF:

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="false" />
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="">
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
    </behavior>

  </endpointBehaviors>

</behaviors>

<services>
  <service name="digiPM.Shell.LogOutPMSEMRService.PMSEMRLogOutService">
    <!--<endpoint address="" binding="basicHttpBinding" contract="digiPM.Shell.LogOutPMSEMRService.IPMSEMRLogOutService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/Design_Time_Addresses/digiPM.Shell.LogOutPMSEMRService/PMSEMRLogOutService/" />
      </baseAddresses>
    </host>-->
    <endpoint address="" binding="netTcpBinding" name="NetTcpBindingEndpoint" contract="digiPM.Shell.LogOutPMSEMRService.IPMSEMRLogOutService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" name="MexTcpBidingEndpoint" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:8732/Design_Time_Addresses/digiPM.Shell.LogOutPMSEMRService/PMSEMRLogOutService/" />
      </baseAddresses>
    </host>
  </service>
</services>

<!--binding info - removed this for the sake of readability for this post -->

web.config en el proyecto de servicio:

<system.serviceModel>

<bindings>
  <wsHttpBinding>
      <binding name="WSHttpBinding_Services" closeTimeout="01:10:00" openTimeout="01:10:00" receiveTimeout="01:10:00" sendTimeout="01:10:00" bypassProxyOnLocal="false" 
               transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" 
               messageEncoding="Mtom" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
          <readerQuotas maxDepth="4096" maxStringContentLength="2147483647" maxArrayLength="524288" maxBytesPerRead="524288" maxNameTableCharCount="524288" />
          <reliableSession ordered="true" inactivityTimeout="01:10:00" enabled="false" />

          <security mode="None">

          </security>
      </binding>
  </wsHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="digiPM.Service.Behavior">
      <serviceMetadata httpGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>

  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="customObjectQuota">
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
    </behavior>
  </endpointBehaviors>
</behaviors>

<services>
  <service behaviorConfiguration="digiPM.Service.Behavior"
    name="digiPM.Service.AddressCrudService">
    <endpoint address="" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_Services"
                name="AddressCrudServiceEndPoint" bindingNamespace="urn:Dawliasoft.Sculpture"  contract="digiPM.Services.Contracts.IAddressCrudService" behaviorConfiguration="customObjectQuota" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"  behaviorConfiguration="customObjectQuota" />
  </service>

 <!--<more services defined with same configuration as above..>-->

  </services>


</system.serviceModel>

Esto, sin embargo, no ha ayudado. Tenga en cuenta que los servicios a los que se hace referencia en APP.CONFIG no son los servicios con los que tengo problemas.

También probé lo siguiente:

agregó estos atributos a la implementación del servicio: [DataContract (IsReference = true)], [ServiceBehavior (AddressFilterMode = AddressFilterMode.Any, MaxItemsInObjectGraph = 2147483646)]

escribió una clase personalizada DataContractSerializerOperationBehavior que establece el comportamiento MaximumObjectsInGraph e IsReference. También se agregó un atributo personalizado para aplicar esto a las implementaciones del servicio. En aras del desorden, no publiqué el código, pero puedo agregarlo si alguien piensa que sería beneficioso.

Pensamientos? Ideas? ¿A donde voy desde aqui

¡Gracias por adelantado

Respuestas a la pregunta(5)

Su respuesta a la pregunta