-
Notifications
You must be signed in to change notification settings - Fork 700
.NET SDK not found if installed via Snap and Snap aliases used #3077
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
Comments
@rmunn this isn't an issue with the C# extension, though I am not sure what I would suggest you do with this issue. If you run |
If I run I'm also not sure where the root cause of this bug lies; if I could figure out what exception is being thrown in IL_Throw from libcoreclr.so, I might have better luck putting this in the right place. But since the only time I can reproduce this bug is when OmniSharp is involved, I figure here is as good a place for the issue to live as any, at least until I can track down the cause better. |
Have the same issue. After running "sudo snap alias dotnet-sdk.dotnet dotnet" dotnet --info works fine in a terminal, but I still get: |
For a quick fix creating a symlink at |
I am going to close this issue since it isn't really about this extension. Note that I am adding a help link to the error message with #3507 which has specific troubleshooting steps for Snap. |
Issue Description
If the .NET SDK has been installed via Snap (
sudo snap install dotnet-sdk
) on Ubuntu 18.04, and a Snap alias has been created withsudo snap alias dotnet-sdk.dotnet dotnet
as recommended in https://github.com/dotnet/core-setup/issues/4230#issuecomment-398841315, then OmniSharp can't find the .NET SDK becausedotnet --info
fails with a SIGABRT when run from inside VS Code. Interestingly,dotnet --info
works just fine when run from the command line.Workaround: If instead of creating a Snap alias, I set my PATH to include
/snap/dotnet-sdk/current
somewhere before/snap/bin
, then thedotnet --info
command works and OmniSharp can find the .NET SDK as it should.If I enable core dumps in Ubuntu, I can get a stack trace from the core dump. Unfortunately, the Snap package for
dotnet-sdk
does not appear to include debugging symbols so the stack trace isn't very useful, but I've included it in the Logs section below anyway.Steps to Reproduce
sudo snap install dotnet-sdk --classic
sudo snap install code --classic
Expected Behavior
OmniSharp runs
dotnet --info
and finds the .NET SDK correctly.Actual Behavior
.NET SDK is not found because
dotnet --info
exists with a SIGABRT.Logs
OmniSharp log
(empty)
C# log
Downloading package 'OmniSharp for Linux (x64)' (43145 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for Linux (x64)'
Downloading package '.NET Core Debugger (linux / x64)' (64083 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (linux / x64)'
Downloading package 'Razor Language Server (Linux / x64)' (58328 KB).................... Done!
Installing package 'Razor Language Server (Linux / x64)'
Finished
Failed to spawn 'dotnet --info'
Stack trace
Stack trace generated by Gdb
Environment information
VSCode version: 1.34.0
C# Extension: 1.19.1
Mono Information
OmniSharp using global mono :5.20.1Dotnet Information (actual)
A valid dotnet installation could not be found.Dotnet Information (expected)
.NET Core SDK (reflecting any global.json): Version: 2.2.204 Commit: 8757db13ecRuntime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /snap/dotnet-sdk/38/sdk/2.2.204/
Host (useful for support):
Version: 2.2.5
Commit: 0a3c9209c0
.NET Core SDKs installed:
2.2.204 [/snap/dotnet-sdk/38/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.5 [/snap/dotnet-sdk/38/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.5 [/snap/dotnet-sdk/38/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.5 [/snap/dotnet-sdk/38/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: