Error while deserializing the object in WCF
rest, serialization, wcf
Solution
In my case, the problem was that I was returning Entity Framework objects that I got from the data context. The solution was to detach each object before retuning them.
Problem
I have created a REST Service in WCF. I am facing the following issue There was an error deserializing the object of type System.Collections.Generic.IList. The maximum read depth (32) has been exceeded because XML data being read has more levels of nesting than is allowed by the quota. This quota may be increased by changing the MaxDepth property on the XmlDictionaryReaderQuotas object used when creating the XML reader. I haven't specified any type of binding in configuration since I have developed the service as per REST Starter Kit. Please suggest something as to how can I fix it. The code is working fine sometimes but it do throw error.