Protobuf de-serializing exception "A repeated type was not expected as an aux type"

Viewed 163

When trying to deserialize an observablecollection, it gives me an exception **"

"An exception of type 'System.NotSupportedException' occurred in protobuf-net.Core.dll but was not handled in user code Additional information: A repeated type was not expected as an aux type:""**

  public Task<T> ReceiveDataAsync<T>(TcpClient client)            
        {
            using (NetworkStream stream = new NetworkStream(client.Client, false))
            {
                return Task.FromResult(Serializer.DeserializeWithLengthPrefix<T>(stream, PrefixStyle.Fixed32));
            }
        }

I haven't found details about this exception at all.

1 Answers

The WithLengthPrefix API expects a single message, not a collection. Maybe serialize something that has a collection.

Related