Dock.Serializer.SystemTextJson does not preserve object identity for ActiveDockable when it references the same instance as VisibleDockables[n]. After serialize/deserialize round-trip ReferenceEquals(dock.ActiveDockable, dock.VisibleDockables[0]) should be true. But STJ serializes ActiveDockable as a second inline copy ($id: "2") instead of $ref. After round-trip two distinct instances exist with the same Id.
I attached a minimal repro C# single-file app repro.cs (dotnet run repro.cs), comparing with Dock.Serializer.Newtonsoft which works correctly.
Dock.Serializer.SystemTextJson does not preserve object identity for ActiveDockable when it references the same instance as VisibleDockables[n]. After serialize/deserialize round-trip ReferenceEquals(dock.ActiveDockable, dock.VisibleDockables[0]) should be true. But STJ serializes ActiveDockable as a second inline copy ($id: "2") instead of $ref. After round-trip two distinct instances exist with the same Id.
I attached a minimal repro C# single-file app repro.cs (
dotnet run repro.cs), comparing with Dock.Serializer.Newtonsoft which works correctly.