Partilhar via


NetDispatchFaultExcetion was unhandled

I just came across this whilst making a web service call from a Windows Forms client application.

Exception text:

"The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter https://tempuri.org/:GetWizardInfoResponse. The InnerException message was 'There was an error deserializing the object of type DataManagementConsoleFileProducer.RegSysWebService.GetWizardInfoResponseBody. The maximum string content length quota (8192) has been exceeded while reading XML data. This quota may be increased by changing the MaxStringContentLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader. Line 222, position 14.'.  Please see InnerException for more details."

Solution:

Increase maxStringContentLength value in the readerQuotas element in projects app.config file.

<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    maxBytesPerRead="4096" maxNameTableCharCount="16384" />

Resources:

This post helped me to work out what was going on:
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3077193&SiteID=1

Comments