Skip to content

[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
copilot/sub-pr-124869
Closed

[release/10.0] Add ERROR_NETNAME_DELETED to IsPathUnreachableError for Windows localhost removal#124907
Copilot wants to merge 1 commit intobackport/pr-121569-to-release/10.0from
copilot/sub-pr-124869

Conversation

Copy link
Contributor

Copilot AI commented Feb 26, 2026

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 through IsPathUnreachableError and hit a Debug.Assert in FillAttributeInfo, causing System.IO.FileSystem.Tests CI failures.

  • Interop.Errors.cs: Added ERROR_NETNAME_DELETED = 0x40
  • FileSystem.Attributes.Windows.cs: Added ERROR_NETNAME_DELETED to the IsPathUnreachableError pattern match alongside existing network errors (ERROR_BAD_NETPATH, ERROR_BAD_NET_NAME, etc.)

Customer Impact

On affected Windows builds, any FileInfo/DirectoryInfo attribute 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.

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
@jozkee jozkee closed this Feb 26, 2026
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