Skip to content

[release/9.0-staging] Fix UNC paths - #111499

Merged
agocke merged 5 commits into
release/9.0-stagingfrom
backport/pr-110033-to-release/9.0-staging
Feb 3, 2025
Merged

[release/9.0-staging] Fix UNC paths#111499
agocke merged 5 commits into
release/9.0-stagingfrom
backport/pr-110033-to-release/9.0-staging

Conversation

@github-actions

@github-actionsgithub-actionsBot commented Jan 16, 2025

Copy link
Copy Markdown
Contributor

Backport of #110033 to release/9.0-staging

/cc @agocke

Customer Impact

  • Customer reported
  • Found internally

This change causes apps which are launched from network shares ("UNC paths" aka \server-name) to have their location shown as extended UNC paths ("\?\UNC\server-name"). This is a regression both because the paths are different from what they were before, but also because some APIs will not accept UNC server paths. This manifests as a breaking change in .NET 9.

Regression

  • Yes
  • No

Regression from .NET 8 to .NET 9.

Testing

Tested manually. Unfortunately we do not have a way to test network shares in our CI system.

Risk

Low risk. The change is targeted to one API and only to paths which have extended UNC paths.

agockeand others added 4 commits January 16, 2025 15:52
If the input file was a network path then the raw path returned by
GetFinalPathByHandle may return a UNC path. If so, and if the original
path wasn't a UNC path, and the original path doesn't need normalization,
we want to use the original path.
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
@ghostghost added the area-Host label Jan 16, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

@jeffschwMSFTjeffschwMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm. please get a code review. we will take for consideration in 9.0.x

@jeffschwMSFTjeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jan 16, 2025
@jeffschwMSFTjeffschwMSFT added this to the 9.0.x milestone Jan 16, 2025
@jeffschwMSFTjeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jan 21, 2025
@jeffschwMSFTjeffschwMSFT modified the milestones: 9.0.x, 9.0.3Jan 21, 2025
@jeffschwMSFT

Copy link
Copy Markdown
Member

@agocke can you take a look at the CI failures? we can merge when ready.

@snakefoot

snakefoot commented Feb 2, 2025

Copy link
Copy Markdown
Contributor

This will just remove the Long UNC-prefix, when not needed. Should one not expect to see the network-drive-letter, instead of the network-path behind the network-drive-letter?

Ex. Z:\rwells\very\special\place (NET8) instead of \\actual-hostname\actual-sharename\rwells\very\special\place (NET9) ?

@agocke

Copy link
Copy Markdown
Member

/ba-g timeout is unrelated and hitting multiple PRs.

@agocke
agocke merged commit 6091bce into release/9.0-stagingFeb 3, 2025
@agocke
agocke deleted the backport/pr-110033-to-release/9.0-staging branch February 3, 2025 03:45
@agocke

Copy link
Copy Markdown
Member

@snakefoot It sounds like your scenario is slightly different. What is the input and output in your case?

@snakefoot

snakefoot commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

I'm just the NLog-project-janitor, and users are having issues when running their NET9-application from a network-drive:

Where System.AppContext.BaseDirectory in NET9 suddenly returns the Long UNC Network-path, instead of the mounted network-drive.

Ex. Z:\rwells\very\special\place (NET8) instead of \\actual-hostname\actual-sharename\rwells\very\special\place (NET9) ?

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-HostServicing-approvedApproved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@jeffschwMSFT@snakefoot@agocke@elinor-fung