This seems like a fairly simple use case, I don't understand how the exception in the following code snippet is being thrown.
static void Main(string[] args)
{
using (var foobar = new MemoryStream())
{
ProtoBuf.Serializer.Serialize(foobar, new Foobar());
if (foobar.Length == 0)
throw new Exception("Didn't serialize");
}
}
[ProtoContract]
public class Foobar
{
[ProtoMember(1)]
public int FoobarInt { get; set; }
}