[release/10.0] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows localhost removal#124907
Closed
Copilot wants to merge 1 commit intobackport/pr-121569-to-release/10.0from
Closed
[release/10.0] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows localhost removal#124907Copilot wants to merge 1 commit intobackport/pr-121569-to-release/10.0from
Copilot wants to merge 1 commit intobackport/pr-121569-to-release/10.0from
Conversation
4 tasks
Copilot
AI
changed the title
[WIP] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows
[release/10.0] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows localhost removal
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main PR #121569
Description
Windows OS updates removed localhost support, returning
ERROR_NETNAME_DELETED(0x40/64) for UNC paths like\\LOCALHOST\share\path. This code fell throughIsPathUnreachableErrorand hit aDebug.AssertinFillAttributeInfo, causingSystem.IO.FileSystem.TestsCI failures.Interop.Errors.cs: AddedERROR_NETNAME_DELETED = 0x40FileSystem.Attributes.Windows.cs: AddedERROR_NETNAME_DELETEDto theIsPathUnreachableErrorpattern match alongside existing network errors (ERROR_BAD_NETPATH,ERROR_BAD_NET_NAME, etc.)Customer Impact
On affected Windows builds, any
FileInfo/DirectoryInfoattribute lookup against a\\LOCALHOST\...UNC path throws an assertion failure instead of returning a clean "path unreachable" result.Regression
Not a code regression — triggered by a Windows OS change removing localhost loopback UNC support. First observed in CI around November 2025.
Testing
Validated by the CI runs that were consistently failing with
"Unexpected error code getting attributes 64 from path \\LOCALHOST"prior to the fix in #121569. No new tests added; the failure requires a specific Windows build with localhost support removed.Risk
Low. Single error code added to an existing pattern match — no logic change, no new code paths.
Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
💡 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.