Closed dandev486 closed 1 year ago
From the dotnet info on the issue it looks like your .net7 SDK is installed in /usr/share/dotnet
.NET SDKs installed: 6.0.412 [/usr/share/dotnet/sdk] 7.0.306 [/usr/share/dotnet/sdk]
If you set the dotnet path to that does it work? Do you have an additional dotnet installation in /usr/bin/
?
@dibarbet, is this setting then intented to point to the actual sdk installation directory and not to the directory where the symlink to dotnet
is?
$ which dotnet
/usr/bin/dotnet
$ ls -lh /usr/bin/dotnet
lrwxrwxrwx 1 root root 22 Jun 20 16:43 /usr/bin/dotnet -> ../share/dotnet/dotnet
$ ls -lh /usr/share/dotnet/dotnet
-rwxr-xr-x 1 root root 143K Jun 20 16:43 /usr/share/dotnet/dotnet
In time, thanks for pointing that out, it works properly when set to /usr/share/dotnet/
, even though my original expectation was that it would suffice to point to the directory where the symbolic link is.
Dotnet path: /usr/share/dotnet/dotnet
Activating C# standalone...
info: LanguageServerHost[0]
Starting server...
[...]
[Info - 8:24:18 PM] [LanguageServerProjectSystem]
Completed (re)load of all projects in 00:00:00.9406406
Ah /usr/bin/dotnet is symlinked, that's useful info. Not sure if that is expected to work, I'll take a look.
In case of this being relevant, the symlink is the one created by the package installation by following the installation instructions (surely, changing '11' to '12' for Debian Bookworm), and not a result of a custom setup of some sort.
Ah ok I think I just understood what is going on. The problem is that only the dotnet executable is symlinked.
While /usr/bin/dotnet
(an executable) is symlinked to /usr/share/dotnet/dotnet
(an executable), the dotnet path option is required to point to the folder containing the runtimes. That folder is /usr/share/dotnet
and /usr/bin/
is not symlinked to it. So when you specified /usr/bin/
as the dotnet path it wasn't able to resolve any runtimes.
The takeaway here is that the dotnetPath
option needs to point to the folder containing the dotnet installation. Symlinks will also work as long as the symlink points to the folder containing the dotnet installation (not just a link to the dotnet executable).
Type: Bug
Issue Description
Language server won't start with custom dotnet path configured through
dotnet.dotnetPath
setting.Steps to Reproduce
Install the extension C# v2.0.328
Explicitly configure
dotnet path
on VSCode settings file, for instance.Create a console application and solution file
Check the logs
Expected Behavior
No errors and the language server launches, providing completion, refactoring, etc.
Actual Behavior
Language server does not launch properly, logs contain messages regarding a missing installation (which is not the case, since I have installed both .NET SDK 6x and .NET SDK 7x), for instance:
Logs
C# log
C# LSP Trace Logs
Environment information
VSCode version: 1.81.0 C# Extension: 2.0.328 Using OmniSharp: false
Dotnet Information
.NET SDK: Version: 7.0.306 Commit: f500069cb7 Runtime Environment: OS Name: debian OS Version: 12 OS Platform: Linux RID: debian.12-x64 Base Path: /usr/share/dotnet/sdk/7.0.306/ Host: Version: 7.0.9 Architecture: x64 Commit: 8e9a17b221 .NET SDKs installed: 6.0.412 [/usr/share/dotnet/sdk] 7.0.306 [/usr/share/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/downloadVisual Studio Code Extensions
|Extension|Author|Version|Folder Name| |---|---|---|---| |cpptools|ms-vscode|1.16.3|ms-vscode.cpptools-1.16.3-linux-x64| |csharp|ms-dotnettools|2.0.328|ms-dotnettools.csharp-2.0.328-linux-x64| |vscode-dotnet-runtime|ms-dotnettools|1.6.0|ms-dotnettools.vscode-dotnet-runtime-1.6.0| |vscode-theme-onedark|akamud|2.3.0|akamud.vscode-theme-onedark-2.3.0| |vscode-theme-onelight|akamud|2.3.0|akamud.vscode-theme-onelight-2.3.0|;Extension version: 2.0.328 VS Code version: Code 1.81.0 (6445d93c81ebe42c4cbd7a60712e0b17d9463e97, 2023-08-02T12:36:11.334Z) OS version: Linux x64 6.1.0-10-amd64 Modes: