mbraceproject / FsPickler

A fast multi-format message serializer for .NET
http://mbraceproject.github.io/FsPickler/
MIT License
324 stars 52 forks source link

Error when deserializing object #70

Closed carlosesquivelunono closed 7 years ago

carlosesquivelunono commented 8 years ago

Hello,

I'm having errors when deserializing this object (serialization works fine). The message says "Expected picker for type but instead found System.Object).

This is my base class, the derived classes only add simple auto-properties.

[Serializable] public abstract class ConcurrentEntity : IConcurrentEntity where T : new() { [NonSerialized] private static readonly T LockObject = new T();

    [NonSerialized]
    private ConcurrentEntity<T> _snapshotObject;

    [JsonIgnore]
    [CustomReplicationBehavior(ReplicationBehavior.Ignore)]
    [IgnoreDataMember]
    public T LockableObject => LockObject;

    internal void TakeSnapshot()
    {
        _snapshotObject = Clone.ObjectGraph(this);
    }

    internal ConcurrentEntity<T> RetrieveSnapshot()
    {
        return _snapshotObject;
    }
}

I'm calling CSPickler.CreateBinarySerializer.UnPickle<T>

Thanks!

dsyme commented 7 years ago

We would need a full simple repro for this. Will close - it's quite an old issue - @carlosesquivelunono please reopen if you can provide a step-by-step repro, thanks