Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hohum, yup looks like a bug (<a href="http://code.google.com/p/protobuf-net/issues/detail?id=78" rel="nofollow noreferrer">now logged</a>); repeatable example below. I'll see if I can fix it on the train (shortly). Sorry 'bout that:</p> <pre><code>using System; using System.IO; using ProtoBuf; [ProtoContract] public class Strange // test entity { [ProtoMember(1)] public string Foo { get; set; } // test prop [ProtoMember(2)] public int Bar { get; set; } // test prop static void Main() { var original = new Strange { Foo = "abc", Bar = 123 }; // serialize and deserialize with base-128 using (MemoryStream ms = new MemoryStream()) { Serializer.SerializeWithLengthPrefix(ms, original, PrefixStyle.Base128,1); ms.Position = 0; object obj; Serializer.NonGeneric.TryDeserializeWithLengthPrefix(ms, PrefixStyle.Base128, i =&gt; typeof(Strange),out obj); var clone = (Strange)obj; Console.WriteLine("Foo via Base128: " + clone.Foo); // works fine Console.WriteLine("Bar via Base128: " + clone.Bar); } // serialize and deserialize with fixed-32 using (MemoryStream ms = new MemoryStream()) { Serializer.SerializeWithLengthPrefix(ms, original, PrefixStyle.Fixed32,1); ms.Position = 0; object obj; // BOOM here; oh how embarrassing Serializer.NonGeneric.TryDeserializeWithLengthPrefix(ms, PrefixStyle.Fixed32, i =&gt; typeof(Strange), out obj); var clone = (Strange)obj; Console.WriteLine("Foo via Fixed32: " + clone.Foo); Console.WriteLine("Bar via Fixed32: " + clone.Bar); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload