Open GoogleCodeExporter opened 9 years ago
Fixed in code, pending deployment
Original comment by marc.gravell
on 12 Jul 2011 at 7:02
Hi. This was supposedly fixed in r432 but I'm seeing a similar problem in r470.
Example code:
[ProtoContract(SkipConstructor = true)]
class B
{
public B()
{
Console.WriteLine("Constructor");
}
}
[ProtoContract]
class A
{
[ProtoMember(1)]
public B b = new B();
}
class Program
{
private static byte[] Serialize(object obj)
{
var stream = new MemoryStream();
Serializer.Serialize(stream, obj);
return stream.ToArray();
}
private static T Deserialize<T>(byte[] serializedData)
{
var stream = new MemoryStream(serializedData);
return Serializer.Deserialize<T>(stream);
}
public static void Main()
{
var data = Serialize(new A());
Console.WriteLine("Calling deserialize");
Deserialize<A>(data);
}
}
Output:
Constructor
Calling deserialize
Constructor
Original comment by logix...@gmail.com
on 2 Dec 2011 at 10:31
Original issue reported on code.google.com by
kevinstu...@gmail.com
on 11 Jul 2011 at 9:38