You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Identical behaviour between .NET Core and .NET Framework, ideally with it working in both.
Actual behavior
Crashes in .NET framework with the following stack trace:
MBrace.FsPickler.NonSerializableTypeException
HResult=0x80131500
Message=Type 'System.IO.DirectoryInfo' is not serializable.
Source=FSharp.Core
StackTrace:
at Microsoft.FSharp.Core.Operators.Raise[T](Exception exn)
at MBrace.FsPickler.PicklerCache.GeneratePickler[T]() in C:\Users\source\repos\FsPicklerTest\FsPicklerTest\FsPickler-5.2\src\FsPickler\PicklerGeneration\PicklerCache.fs:line 64
at MBrace.FsPickler.FsPicklerTextSerializer.Serialize[T](TextWriter writer, T value, FSharpOption`1 pickler, FSharpOption`1 streamingContext, FSharpOption`1 leaveOpen) in C:\Users\source\repos\FsPicklerTest\FsPicklerTest\FsPickler-5.2\src\FsPickler\FsPickler\TextSerializer.fs:line 35
at <StartupCode$FsPickler>[email protected](TextWriter m, T v) in C:\source\repos\FsPicklerTest\FsPicklerTest\FsPickler-5.2\src\FsPickler\FsPickler\TextSerializer.fs:line 122
at MBrace.FsPickler.FsPicklerTextSerializer.PickleToString[T](T value, FSharpOption`1 pickler, FSharpOption`1 streamingContext)
at Program.main(String[] _arg1) in Program.fs:line 27
Current Findings
I did some investigating into this, it seems the cause is that 'isUnsupportedType' inside PicklerGenerator.fs checks the type to see if IsMarshalByRef is set. In the .NET framework app it is set to true. However, in .NET Core it is not.
Related information
Operating system - Windows 10
Target F# runtime 4.4.3.0 (4.1)
.NET Framework 4.7.1
.NET Core 2.0
FsPickler 5.2.0
FsPickler.Json 5.2.0
The text was updated successfully, but these errors were encountered:
It looks like this issue should be fixed now that you've merged PR #106 . Do you have any idea how long it will be before an FsPickler release will include this change?
Description
Trying to serialise a DirectoryInfo succeeds in a .NET Core app but fails in a .NET Framework app
Code
Expected behavior
Identical behaviour between .NET Core and .NET Framework, ideally with it working in both.
Actual behavior
Crashes in .NET framework with the following stack trace:
Current Findings
I did some investigating into this, it seems the cause is that 'isUnsupportedType' inside PicklerGenerator.fs checks the type to see if IsMarshalByRef is set. In the .NET framework app it is set to true. However, in .NET Core it is not.
Related information
Operating system - Windows 10
Target F# runtime 4.4.3.0 (4.1)
.NET Framework 4.7.1
.NET Core 2.0
FsPickler 5.2.0
FsPickler.Json 5.2.0
The text was updated successfully, but these errors were encountered: