Install dotnet 6.0.301 on Linux. I have tried Ubuntu and Debian on WSL.
sudo apt install dotnet-sdk-6.0
Run this script using dotnet fsi
#r "nuget:Newtonsoft.Json"
open Newtonsoft.Json
JsonConvert.SerializeObject {| x = 1 |}
|> printfn "%s"
or
type R = { x: int }
JsonConvert.SerializeObject { x = 1 } |> printfn "%s"
In either case output is
{"x@":1,"x":1}
Install 6.0.203
sudo apt install dotnet-sdk-6.0=6.0.203-1
output is
{"x":1}
Serialization is correct on Windows, and when using a regular class, only records in scripts are affected
Workaround
Use dotnet fsi --multiemit-