Error Adding Service Reference – Maximum Nametable Character Count

This is a very frustrating problem. I have a big WCF service with a lot of methods. When I try to add the reference in VS I get:

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. Line 1, position 332845.

I can clearly see in the web config this line:



maxBytesPerRead=4096maxNameTableCharCount=16384 />

but no matter what I set maxNameTableCharCount to, it errors because this entry is not added until the reference is successfully added. The advanced button on the add service reference screen doesn’t have any options to change this value.

What can I do? Please don’t tell me to use svcutil to do this manuallly. Well, if you do, at least tell me which parameters to specify.


Hi Christian, Try to increase the value on both the client and service-side (typical app.config & web.config) manually by editing the files. Good luck, –larsw/

I’ve already done that but nothing in there helps.

Can you post more of your config files?  You might be missing something.  As Lars said, make sure this is on the client and server too.  However post your config and lets look at it more.