neuecc/Utf8Json

generated serializer does not support deserialize.

frankinstien opened this issue · 1 comments

I'm getting the error below, however, with other serializers there's no problem.

generated serializer for DbDescriptor does not support deserialize.
at Utf8Json.Formatters.ThinServerDatabase_Model_DbDescriptorFormatter1.Deserialize(JsonReader& , IJsonFormatterResolver )
at Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)
at BinarySerializer.Serializers.UTF8.Deserialize[T](String jSon) in I:\OneDrive\ThinDatabase\BinarySerializer\Serializers\UTF8.cs:line 13
at BinarySerializer.Serializers.SerailizerFileExtenstions.ObjectStringDeSerializerETX[T](ISerializer serializer, Stream fileSource, List`1 filePostions) in I:\OneDrive\ThinDatabase\BinarySerializer\Serializers\SerailizerFileExtenstions.cs:line 254


at Utf8Json.Formatters.ThinServerDatabase_Model_DbDescriptorFormatter1.Deserialize(JsonReader& , IJsonFormatterResolver )
at Utf8Json.JsonSerializer.Deserialize[T](Byte[] bytes, Int32 offset, IJsonFormatterResolver resolver)
at BinarySerializer.Serializers.UTF8.Deserialize[T](String jSon) in I:\OneDrive\ThinDatabase\BinarySerializer\Serializers\UTF8.cs:line 13
at BinarySerializer.Serializers.SerailizerFileExtenstions.ObjectStringDeSerializerETX[T](ISerializer serializer, Stream fileSource, List`1 filePostions) in I:\OneDrive\ThinDatabase\BinarySerializer\Serializers\SerailizerFileExtenstions.cs:line 254

[Serializable]
public class IndexEntry
{
[DataMember]
public Guid ID { set; get; }
[DataMember]
public DbAddress Address { set; get; }
[DataMember]
public String ObjectType { set; get; }

    [IgnoreDataMember]
    public long FilePosition {
        set
        {
            FilePointer = BitConverter.GetBytes(value);
        }
        get
        {
            return BitConverter.ToInt64(FilePointer, 0);
        }
    }

    [DataMember]
    public byte[] FilePointer { set; get; }

    public IndexEntry(Guid id, DbAddress addr, String objType, long filePos)
    {
        ID = id;
        Address = addr;
        ObjectType = objType;
        FilePosition = filePos;
    }
}`

`

IndexEntry class need a parameterless constructor to be deserialized