Skip to content

Disambiguate object serializer stream on .NET 11 - #2385

Open
Rui Chen (chenrui333) wants to merge 1 commit into
microsoft:mainfrom
chenrui333:chenrui333/net11-serializer-stream-alias
Open

Rui Chen (chenrui333) wants to merge 1 commit into
microsoft:mainfrom
chenrui333:chenrui333/net11-serializer-stream-alias

Conversation

@chenrui333

Copy link
Copy Markdown

Problem

Building Garnet 2.2.12 for net11.0 fails with CS0104 in GarnetObjectSerializer.Deserialize: both System.Buffers and Garnet.common expose ReadOnlySequenceStream. This was encountered in Homebrew/homebrew-core#325463.

Change

Add a file-scoped alias for Garnet.common.ReadOnlySequenceStream, following the existing alias convention in RespCommandDataProvider.cs. This disambiguates both the constructor and its XML documentation reference without changing the stream implementation or serialization behavior.

Validation

  • Confirmed the existing Linux build diagnostic identifies the ambiguous constructor reference.
  • Downloaded the exact v2.2.12 release archive used by Homebrew and verified that the commit-pinned patch applies cleanly with git apply --check.
  • No local compile or runtime tests: no .NET SDK is installed on this workstation. A real Garnet.server.csproj build for net11.0 remains required.

Use the Garnet.common type explicitly through an alias so the streaming constructor and XML reference remain unambiguous when System.Buffers also exposes ReadOnlySequenceStream.

Signed-off-by: Rui Chen <rui@chenrui.dev>
Copilot AI balanced review requested due to automatic review settings November 14, 2026 06:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the stream-alias change, although a net11.0 build remains unverified.

No open issues 🎉

What changed in this PR

Resolves the .NET 11 ReadOnlySequenceStream name ambiguity in Garnet’s object serializer without changing serialization behavior.

Changes:

  • Adds a file-scoped alias for Garnet.common.ReadOnlySequenceStream, disambiguating both the constructor and XML documentation reference.

A net11.0 build remains unverified.

File Description
libs/​server/​Objects/​Types/​GarnetObjectSerializer.cs Adds an explicit alias selecting Garnet’s stream implementation.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants