dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

`dotnet.dotnetPath` should support workspace relative paths #6471

Open dibarbet opened 1 year ago

dibarbet commented 1 year ago

Copied from https://github.com/microsoft/vscode-dotnettools/issues/53

Describe the Issue

My repo provisions a repo-local installation of the .NET SDK. As such, my workspace settings previously had "omnisharp.dotnetPath": "../.dotnet", which worked.

After upgrading to the prerelease version of the C# extension (v2.0.206), I adjusted this setting to "dotnet.dotnetPath": "../.dotnet".

The language server now fails to start and my C# console output shows:

[Error - 11:20:17 AM] Microsoft.CodeAnalysis.LanguageServer client: couldn't create connection to server.
Error: Cannot find dotnet path '../.dotnet/dotnet'

Steps To Reproduce

No response

Expected Behavior

No response

Environment Information

No response

dibarbet commented 12 months ago

Adjusting to backlog for now. We can definitely add support for relative paths to dotnet.dotnetPath - but it won't be super useful by itself. Neither the CLI, nor project loading (in either devkit or c#) will use this path. That generally requires SDK support as described in https://github.com/microsoft/vscode-dotnettools/issues/63#issuecomment-1716741944

Related - https://github.com/dotnet/sdk/issues/8254

geekley commented 10 months ago

Yes, please. It should either support variable substitution like ${workspaceFolder} and ${userHome} and/or at least be resolved relative to workspace, so that we can have this setting locally per-repository through e.g. git-ignored symlinks (since VSCode still doesn't support local workspace settings, it can't be an absolute path because you can't guarantee this workspace setting can be git-ignored).