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

[MSBuild]::MakeRelative fails with "Invalid URI: The hostname could not be parsed." when using opening from WSL2 #6310

Closed
rlabrecque opened this issue Mar 30, 2021 · 3 comments
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@rlabrecque
Copy link

rlabrecque commented Mar 30, 2021

Issue Description

When you have a VS2019 C# project inside a WSL2 container and try to open it, you can end up with this error:

\\wsl$\Debian\home\user\Redacted\Redacted.csproj : error  :
The expression "[MSBuild]::MakeRelative(\\wsl$\Debian\home\user\Redacted, \\wsl$\Debian\home\user\Redacted\obj\project.assets.json)" cannot be evaluated.
Invalid URI: The hostname could not be parsed.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\NuGet\16.0\Microsoft.NuGet.targets

Note: This might be a problem with UNC paths in general, or may be the damn dollar sign in \wsl$, haven't dug that far into it.

Versions & Configurations

Windows 10H2
WSL2
Visual Studio 2019 Version 16.9.2

@rlabrecque rlabrecque added bug needs-triage Have yet to determine what bucket this goes in. labels Mar 30, 2021
@danmoseley
Copy link
Member

See dotnet/runtime#36595

@rlabrecque
Copy link
Author

rlabrecque commented Mar 30, 2021

Perfect, thanks. I believe I have seen the WSL2 team also mentioning a switch away from \wsl$\ elsewhere as well, that would be the ideal solution to all of this.

Feel free to close this if you want, there should be enough info here for the next person to search for this ticket.

@danmoseley
Copy link
Member

It's not my repo, but since the issue is in my repo, I will be bold and close this..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

No branches or pull requests

2 participants