Open dibarbet opened 8 months ago
This issue has been marked as stale after 14 days of inactivity. @[ @AArnott @], could you please take a look?
@lifengl should probably look at this as he owns the SDK/runtime acquisition now.
im also having the same issue. this is the dotnet --info
result from the vscode's integrated terminal:
.NET SDK:
Version: 8.0.300
Commit: 326f6e68b2
Workload version: 8.0.300-manifests.c1c70047
MSBuild version: 17.10.4+10fbfbf2e
Runtime Environment:
OS Name: ubuntu
OS Version: 24.04
OS Platform: Linux
RID: linux-x64
Base Path: /snap/dotnet-sdk/245/sdk/8.0.300/
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.5
Architecture: x64
Commit: 087e15321b
.NET SDKs installed:
8.0.300 [/snap/dotnet-sdk/245/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.5 [/snap/dotnet-sdk/245/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.5 [/snap/dotnet-sdk/245/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/snap/dotnet-sdk/current]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
but vscode does not seem to be able to run the same command correctly:
Failed to find dotnet info from path, falling back to acquire runtime via ms-dotnettools.vscode-dotnet-runtime
Error running dotnet --info: Error: Command failed: dotnet --info
Aborted (core dumped)
Aborted (core dumped)
Dotnet path: /home/x/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/8.0.6~x64/dotnet
Activating C# + C# Dev Kit + C# IntelliCode...
waiting for named pipe information from server...
[stdout] {"pipeName":"/tmp/6442fe69.sock"}
received named pipe information from server
attempting to connect client to server...
client has connected to server
[Info - 9:57:04 AM] [Program] Language server initialized
also i dont know if it matters but the vscode is also installed via snap (with --classic
confinement too same as the dotnet):
name: code
summary: Code editing. Redefined.
publisher: Visual Studio Code (vscode✓)
store-url: https://snapcraft.io/code
contact: https://twitter.com/code
license: unset
description: |
Visual Studio Code is a new choice of tool that combines the
simplicity of a code editor with what developers need for the core
edit-build-debug cycle.
commands:
- code
- code.url-handler
snap-id: Ht0aUHi7ofh9Fbwh6m7jUN2pAy6kzBiu
tracking: latest/stable
refresh-date: 5 days ago, at 00:46 WIB
channels:
latest/stable: 5437499f 2024-06-19 (162) 327MB classic
latest/candidate: ↑
latest/beta: ↑
latest/edge: ↑
installed: 611f9bfc (161) 327MB classic
Describe the Issue
This was originally reported on the C# extension side here - https://github.com/dotnet/vscode-csharp/issues/6513 (with a fix in the upcoming release).
When dotnet is installed via snap on ubuntu, the devkit server fails to start
From the investigation in https://github.com/dotnet/vscode-csharp/issues/6513 the basic cause is that the
dotnet
on the path is symlinked to/usr/bin/snap
which is the snap executable. However devkit is expecting it to find the dotnet executable in the dotnet installation directory.Alternatively, running ls -l
The real location of the dotnet install is something like
/snap/dotnet-sdk/221/dotnet
or/snap/dotnet-sdk/current/dotnet
The fix we made on the C# extension side was to instead read the output of the runtime path (from
dotnet --list-runtimes
and look 2 directories up for the executable. Since they use the assembly path this should always output the 'real' dotnet installation directory. Ran this by the runtime/sdk folks who said it should be fine See https://github.com/dotnet/vscode-csharp/issues/6513#issuecomment-1756249012C# extension PR: https://github.com/dotnet/vscode-csharp/pull/6515
Steps To Reproduce
Repro steps
snap install dotnet-sdk --classic --channel=7.0
Expected Behavior
Devkit server starts
Environment Information
Dotnet info