-
Notifications
You must be signed in to change notification settings - Fork 822
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
Network resource \\wsl$\ is invalid according to .NET's System.Uri #4722
Comments
This seems like a .NET issue, not a WSL issue. |
As far as I know, a valid hostname may only contain letters It's a WSL design decision to deliberately use an invalid hostname In other words: WSL has opted for a non-standard hostname. This can create problems with any software working with hostnames and expecting strict standard conformity. This includes, but is not limited to, the .NET Framework itself as well as apps built on top of it. |
dotnet/runtime#36595 (comment) seems they are planning to change the hostname to something else which doesn't violates the spec. |
According to the release notes, this has been fixed in build 20175:
|
I'm on Windows 10 version 1909 [build 10.0.18363.476] and have Ubuntu 18.04 running in WSL.
I've noticed that some Windows apps have issues when accessing Linux paths as network resource in the form of
\\wsl$\Ubuntu-18.04\some\dir
.In my case, these apps are using the .NET API System.Uri to validate uniform resource identifiers (URI).
I made some tests and concluded the problem is very likely that
\\wsl$\
is an invalid machine name:\\wsl$\Ubuntu-18.04\some\dir
is accessible as any normal directory, e.g. from the Windows Explorer.\\wsl$\Ubuntu-18.04\some\dir
with methods like System.Uri.TryCreate fails.Formally, this result seems to be correct to me, since
\\wsl$\
is effectively an invalid name for network resources.Here's a minimal example for reproduction with .NET Core 3.0:
The output is:
I am aware of #4308, which I think is describing the same issue.
However, the problem is not limited to Visual Studio, but probably affecting any .NET app using URIs.
The text was updated successfully, but these errors were encountered: