We are using NetTCPbinding in WCF in our project. Recently, as the number of service operations increased beyond 75, we are facing this error while starting our service.
There is an error in the XML document.
The maximum nametable character count quota (16384) has been exceeded while reading XML data. The nametable is a data structure used to store strings encountered during XML processing - long XML documents with non-repeating element names, attribute names and attribute values may trigger this quota. This quota may be increased by changing the MaxNameTableCharCount property on the XmlDictionaryReaderQuotas object used when creating the XML reader.
As suggested in this error message, we have increased the quota on MaxNameTableCharCount
property, but it is not solving our issue.
Our team have also followed the solutions given in the links below. But, none of these is working for us.
WCF - The maximum nametable character count quota (16384) has been exceeded while reading XML data
http://geekswithblogs.net/claraoscura/archive/2007/08/20/114806.aspx
http://mnairooz.blogspot.in/2010/06/maximum-nametable-character-count-quota.html
Please find below our app.config on server side
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
<system.serviceModel>
<services>
<service behaviorConfiguration="Test.ServiceLibraryHost.ServiceBehavior"
name="Test.ServiceLibraryHost.TestService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="myNetTcpBinding" contract="Test.ServiceLibraryHost.ITestService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"/>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8529/TestService"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Test.ServiceLibraryHost.ServiceBehavior">
<serviceMetadata />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="myNetTcpBinding">
<readerQuotas maxDepth="32" maxStringContentLength="21745878" maxArrayLength="21745878"
maxBytesPerRead="21745878" maxNameTableCharCount="21745878" />
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Any help, in this case, would be highly appreciated. Let me know in case you need any more information. Thank you.