Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Serialization is being removed #1411

Open
TheAngryByrd opened this issue Jul 16, 2024 · 6 comments
Open

Binary Serialization is being removed #1411

TheAngryByrd opened this issue Jul 16, 2024 · 6 comments

Comments

@TheAngryByrd
Copy link

I installed dotnet preview 9 and with DOTNET_ROLL_FORWARD_TO_PRERELEASE=1 I'm getting this error during build.

       Using "WebSharperTask" task from assembly "C:\Users\jimmy\.nuget\packages\websharper.fsharp\6.1.7.441-net8\build\/../tools/netstandard2.0/WebSharper.MSBuild.FSharp.dll".
       Task "WebSharperTask"
         C:\Users\jimmy\.nuget\packages\websharper.fsharp\6.1.7.441-net8\build\/../tools/net8.0/win-x64/wsfsc.exe "@C:\Users\jimmy\AppData\Local\Temp\tmpsyctnf.tmp"
         Unhandled exception. System.PlatformNotSupportedException: BinaryFormatter serialization and deserialization have been removed. See https://aka.ms/binaryformatter for more information.
            at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
            at WebSharper.FSharp.NamedPipeClient.sendCompileCommand(String[] args)
            at WebSharper.FSharp.Program.main(String[] argv)
 28:148>C:\Users\jimmy\.nuget\packages\websharper.fsharp\6.1.7.441-net8\build\WebSharper.FSharp.targets(50,5): error MSB6006: "wsfsc.exe" exited with code -532462766.

Binary Formatter has been doing a slow obsolete for a while:

@granicz
Copy link
Member

granicz commented Jul 16, 2024

I am not up to date on the current serialization options, @TheAngryByrd - what's your take on the best way forward?

@TheAngryByrd
Copy link
Author

Since ArgsType seems to be record with string array:

type ArgsType = {args: string array}

Replacing BinaryFormatter calls it with something like System.Text.Json should be fairly straight forward.

@granicz
Copy link
Member

granicz commented Jul 19, 2024

OK, had a quick look, the offending piece is in the Booster communication code, and indeed should be quick to change it to use a more appropriate serializer. /cc @Jooseppi12

Jooseppi12 added a commit that referenced this issue Jul 27, 2024
@granicz
Copy link
Member

granicz commented Sep 4, 2024

@Jooseppi12 Is this released, and if so, what version? If not, let's roll it out.

@Jooseppi12
Copy link
Member

This is released for the WebSharper 8 packages on our GitHub feed, but was not backported to the websharper6 branch

@granicz
Copy link
Member

granicz commented Sep 4, 2024

OK, keeping this ticket open for the WS6 port as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants