Obsolete NamedPipeClientStream constructor with isConnected parameter (SYSLIB0063)#120328
Obsolete NamedPipeClientStream constructor with isConnected parameter (SYSLIB0063)#120328
Conversation
… (SYSLIB0063) Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
This PR obsoletes the NamedPipeClientStream constructor that takes a bool isConnected parameter (as it's effectively meaningless) and introduces a new constructor without this parameter. The isConnected parameter only ever had one valid value (true), making it redundant and confusing.
Key changes:
- Introduces diagnostic ID
SYSLIB0063for the obsolete constructor - Adds a new constructor without the
isConnectedparameter that always sets the connection state toConnected - Updates existing tests to use the new constructor or suppress the obsolete warning where necessary
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs | Adds the new constructor and marks the old one as obsolete with SYSLIB0063 |
| src/libraries/System.IO.Pipes/ref/System.IO.Pipes.cs | Updates reference assembly with new constructor and obsolete attribute |
| src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj | Links Obsoletions.cs to the project |
| src/libraries/Common/src/System/Obsoletions.cs | Defines SYSLIB0063 diagnostic ID and message |
| docs/project/list-of-diagnostics.md | Documents the new SYSLIB0063 diagnostic |
| src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs | Adds tests for the new constructor and updates existing tests with pragma warnings |
| src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CrossProcess.cs | Updates to use new constructor |
| src/libraries/System.IO.Pipes/tests/PipeStreamConformanceTests.cs | Updates to use new constructor |
…lidate tests Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
…ion" This reverts commit 071c67f.
jeffhandley
left a comment
There was a problem hiding this comment.
Nice to see Copilot following our obsoletion instructions!
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Show resolved
Hide resolved
…andle Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
src/libraries/System.IO.Pipes/src/System/IO/Pipes/NamedPipeClientStream.cs
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: jozkee <16040868+jozkee@users.noreply.github.com>
Done. Applied all feedback with commit 8f4a2d1:
|
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.Pipes/tests/NamedPipeTests/NamedPipeTest.CreateClient.cs
Outdated
Show resolved
Hide resolved
Remove lambdas
|
@jozkee Is this for .NET 10 or 11? Will you open a breaking change issue? |
|
@gewarren, it's for 11 but I don't think we need a breaking change doc, see #120328 (comment). |
@jozkee But this can break your build because of the SYSLIB warning, right? So doesn't it affect source compatibility? |
|
Oh, yes, that's true. That also aligns with previous obsoleted APIs: Thanks for pointing it out. |
|
Added When you commit this breaking change:
Tagging @dotnet/compat for awareness of the breaking change. |
|
@jozkee looks like this went out in preview 1 but not mentioned in docs yet |
✅ Implementation Complete: Obsolete NamedPipeClientStream constructor with isConnected parameter (SYSLIB0063)
Summary of Changes
This PR implements the approved API proposal to obsolete the
NamedPipeClientStreamconstructor that takes abool isConnectedparameter, and introduces a new constructor without it.Changes Made:
NamedPipeClientStream(PipeDirection, bool, SafePipeHandle)that always sets state to Connected[Obsolete]and[EditorBrowsable(EditorBrowsableState.Never)]attributesAPI Changes:
Compatibility:
isConnectedparameter is now ignored by delegating to the new constructorOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.