mbraceproject / FsPickler

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

Crashing on Uri #43

Closed haf closed 8 years ago

haf commented 9 years ago
  Nessos.FsPickler.FsPicklerException: Error deserializing object of type 'ns.A+B+ReactorModel'. ---> System.InvalidCastException: Cannot cast from source type to destination type.
at (wrapper castclass) object.__castclass_with_cache (object,intptr,intptr) <IL 0x0002c, 0x0005b>
at Nessos.FsPickler.CompositePickler`1<Nessos.FsPickler.AssemblyInfo>.Read (Nessos.FsPickler.ReadState,string) <0x002b3>
at Nessos.FsPickler.ReflectionPicklers/memberInfoReader@161.Invoke (Nessos.FsPickler.ReadState,string) <IL 0x00076, 0x000c0>
at Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, string>.InvokeFast<System.Reflection.MemberInfo> (Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, Microsoft.FSharp.Core.FSharpFunc`2<string, System.Reflection.MemberInfo>>,Nessos.FsPickler.ReadState,string) <0x0004e>
at <StartupCode$FsPickler>.$CompositePickler/reader@112<System.Type, System.Reflection.MemberInfo>.Invoke (Nessos.FsPickler.ReadState,string) <0x00037>
at Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, string>.InvokeFast<System.Type> (Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, Microsoft.FSharp.Core.FSharpFunc`2<string, System.Type>>,Nessos.FsPickler.ReadState,string) <0x0004e>
at Nessos.FsPickler.CompositePickler`1<System.Type>.Read (Nessos.FsPickler.ReadState,string) <0x00337>
at <StartupCode$FsPickler>.$ISerializablePickler/reader@118-36<System.Uri>.Invoke (Nessos.FsPickler.ReadState,string) <0x002d3>
at Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, string>.InvokeFast<System.Uri> (Microsoft.FSharp.Core.FSharpFunc`2<Nessos.FsPickler.ReadState, Microsoft.FSharp.Core.FSharpFunc`2<string, System.Uri>>,Nessos.FsPickler.ReadState,string) <0x0004e>
// etc

Unfortunately I don't have a better repro right now as it's pretty deep inside my own code.

eiriktsarpalis commented 9 years ago

This looks like a bug but I can't make much of it just from the stacktrace. I need to know how this object was serialized in the first place to understand what is going on.