【发布时间】:2013-01-30 22:39:22
【问题描述】:
这似乎是一个相当简单的用例,我不明白以下代码 sn-p 中的异常是如何抛出的。
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; }
}
【问题讨论】:
标签: c# protobuf-net