Skip to content

Dock.Serializer.SystemTextJson does not preserve object identity for ActiveDockable #1104

Description

@RoepStoep

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions