mbraceproject / FsPickler

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

How to prevent the pickler from using fully qualified names? #124

Closed thomasd3 closed 2 years ago

thomasd3 commented 2 years ago

I have an error where un-pickling data triggers this error:

it expects:

'Microsoft.FSharp.Collections.FSharpMap`2[IExchange.Instrument,Testing+TrendAnalysis[]]'

but got: 'Microsoft.FSharp.Collections.FSharpMap`2[IExchange.Instrument,Program+TrendAnalysis[]]'

The object to deserialize to is the same, I just relocated it in the project. How can I prevent it from using the full name of the object so that the definitions can be moved around?

eiriktsarpalis commented 2 years ago

Per documentation in http://mbraceproject.github.io/FsPickler/ the serializer is not designed with version tolerance in mind. That being said, it should be possible to work around that issue by providing a custom implementation of the ITypeNameConverter interface.