Kittyfisto/IsabelDb

Crash serialising a custom type containing list of structs

Opened this issue · 0 comments

Add an object of type ManyEntries to the database causes it to crash in protobuf-net:

[DataContract]
public struct Entry
{
    [DataMember]
    public string Name { get; set; }

    [DataMember]
    public int Value { get; set; }
}

[DataContract]
public sealed class ManyEntries
{
    [DataMember]
    public List<Entry> Values { get; set; }
}

The crash does not occur when Entry is changed from being a struct to being a class.