Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around for UriFormatException caused by \\?\ prefix in the path #71082

Merged
merged 3 commits into from
Jun 22, 2022

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Jun 21, 2022

When the path populated by AppDomain.CurrentDomain.BaseDirectory starts with \\?\ (long path prefix) Uri constructor throws UriFormatException: Invalid URI: The hostname could not be parsed which causing WinForms designer failure:
image

Moving the Uri creation code to where it is used and using Uri.TryCreate instead of the ctor

Please see the details from the issue: #70318

Fixes #70318

@ghost
Copy link

ghost commented Jun 21, 2022

Tagging subscribers to this area: @dotnet/area-system-configuration
See info in area-owners.md if you want to be subscribed.

Issue Details

When the path populated by AppDomain.CurrentDomain.BaseDirectory starts with \\?\ (long path prefix) Uri constructor throws UriFormatException: Invalid URI: The hostname could not be parsed which causing WinForms designer failure:
image

Moving the Uri creation code to where it is used and using Uri.TryCreate instead of the ctor

Please see the details from the issue: #70318

Fixes #70318

Author: buyaa-n
Assignees: -
Labels:

area-System.Configuration

Milestone: -

@buyaa-n buyaa-n merged commit 78a2627 into dotnet:main Jun 22, 2022
@buyaa-n buyaa-n deleted the workaround-uri branch June 22, 2022 21:26
@buyaa-n
Copy link
Contributor Author

buyaa-n commented Jun 29, 2022

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2585103475

@ghost ghost locked as resolved and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants