RC0 Serialization Errors

Once I upgraded to RCO tonight certain operations fail that have objects with Byte[] public properties. These objects are not DataContracts and are Serializable and marked with XmlSerialization attributes. This worked just fine in the Feb CTP

System.ServiceModel.FaultException: The formatter threw an exception while trying to deserialize the message: Error while trying to deserialize parameter urn:gridgistics:fabric:manifest. There was an error deserializing the object of type Gridgistics.Fabric.Manifest.ApplicationManifest

Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)



Answer this question

RC0 Serialization Errors

  • TonyMS

    I converted my whole object into a byte array and sent it across and now i get this which appears to be the root of the problem. How do i fix this

    The formatter threw an exception while trying to deserialize the message: Error in deserializing body of message . The maximum array length (16384) has been exceeded.


  • csi95

    internal static class EncoderDefaults
    {
       // Methods
       static EncoderDefaults();
       private static XmlDictionaryReaderQuotas GetDefaultReaderQuotas();
    
       // Fields
       internal const int MaxArrayLength = 0x4000;
       internal const int MaxBytesPerRead = 0x1000;
       internal const int MaxDepth = 0x20;
       internal const int MaxNameTableCharCount = 0x4000;
       internal const int MaxReadPoolSize = 0x40;
       internal const int MaxStringContentLength = 0x2000;
       internal const int MaxWritePoolSize = 0x10;
       internal static readonly XmlDictionaryReaderQuotas ReaderQuotas;
    }
     
    Here is where the quotas are defined and the the NetTcpBinding is using these by default. 
    I have not figured out how to fix it quite yet in config, but this is the issues I believe.

  • GO2GUY

    Thanks for your feedback Dan,If possible,can you please share your repro code,so I will try to repro error message here and we will try to improve this error message.

    my email id is madhup@microsoft.com

    -Thank you

    Madhu



  • JenLeonard

    <readerQuotas maxArrayLength="110000"/> is the fix.

    Please bubble the right exception up as my byte arrays were down the object graph and the initial post was the error I got. It makes no mention of array size quotas


  • RC0 Serialization Errors