Skip to content

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

Development

Successfully merging this pull request may close these issues.

Reading application settings in NET WinForms OOP designer fails with exception 'Invalid URI: The hostname could not be parsed"

3 participants