WCF XmlDictionaryReaderQuotas doesn't exist

Solved.

Need to add manually the reference: System.Runtime.Serialization and then the class XmlDictionaryReaderQuotas will be showen in System.Xml


You don't need to create an instance of XmlDictionaryReaderQuotas. The binding already has one such instance, so you can use it directly:

BasicHttpBinding bhb = new BasicHttpBinding;
bhb.ReaderQuotas.MaxArrayLength = 1000000;

If you're in a platform such as Silverlight, however (and if it's the case, please add the appropriate tag in your question), this property isn't exposed. That's because this quota isn't enforced in that platform - it's essentially the same behavior as if the quota existed, but it was set to the maximum value (int.MaxValue). So you don't need to increase it (it's already max'd out), and you can't decrease it.

Tags:

C#

Wcf