-
Notifications
You must be signed in to change notification settings - Fork 680
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
The .NET Core SDK cannot be located - Linux (Debian) #6179
Comments
Extra context: I'm running vscode on my macbook, but using vscode's Remote Explore to ssh into my linux machine. I have dotnet installed in both macbook and linux. |
Thanks for the report. I'm having trouble reproing this on my linux machine, so I could use some additional info. I have a couple guesses, but not 100% sure.
|
Yes, I tried this after it didn't work. I added... oh! I added the Mac path, not the Linux path, let me change that to the Linux path: Nope, still doesn't work after restarting vscode
I'm happy to try it out! One sec, let me uninstall the other one...
|
Aside, good to know about the C# output! If nothing else works, I bet I can symlink the path below to
|
Ok, I tried your fix! Here is what happened in the C# output:
|
Ok, I don't think your fix is the problem with the above. I uninstalled the C# extension and symlinked:
But I see that same issue after installing the C# extension from the store
|
Thanks, that at least rules out a couple issues. I wouldn't recommend symlinking to runtime downloaded in the vscode global storage, that's likely not going to help - it shouldn't be using that copy to begin with. The interesting thing here is that your manual 'dotnet --info' output looks correct - but the when the extension runs 'dotnet --info' it appears to be only running against the downloaded runtime version. This can happen for example if DOTNET_ROOT is pointing to the wrong location. Three things to try until I can look more on Monday
|
This worked! That error is gone! I've verified this only works if I use your fix.
Feel free to ignore the rest of this message
Ok, I installed your fix and I still have that cli paths option as the CLI: Still seeing the error |
I still see these kinds of errors, but maybe they're not as important?
one sec, taking a while to reinstall your fix... |
Wait, I'm getting the same errors again (on your fix), let me try to reset all the settings I shouldn't have uninstalled your fix and tried the current version on the extension store Actually, I'm not sure it was ever fixed (This can definitely wait til Monday, thanks!!!)
Oh, and I currently have omnisharp.json set on my remote linux machine, even tho I didn't install using snap:
I found this in help page https://github.com/dotnet/vscode-csharp/wiki/Troubleshooting:-'The-.NET-Core-SDK-cannot-be-located.'-errors |
They're unexpected, but almost certainly unrelated to the dotnet issue here. If you could set the
So I've just updated my PR to adjust the logging to see if I can get more details on what exactly is going wrong. The new extension version is here if you wouldn't mind trying it: https://artprodcus3.artifacts.visualstudio.com/A6fcc92e5-73a7-4f88-8d13-d9045b45fb27/cbb18261-c48f-4abb-8651-8cdcb5474649/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2RuY2VuZy1wdWJsaWMvcHJvamVjdElkL2NiYjE4MjYxLWM0OGYtNGFiYi04NjUxLThjZGNiNTQ3NDY0OS9idWlsZElkLzM4MDM3Mi9hcnRpZmFjdE5hbWUvVlNJWHMrLStBdHRlbXB0KzE1/content?format=file&subPath=%2Fcsharp-linux-x64-2.0.402-gc1f776a5b2.vsix And, if you could run Btw, I definitely appreciate you trying everything out here, it's extremely useful. |
You are helping me! Thanks!
C# logs
C# LSP trace logs:
|
So this seems to indicate it can't find dotnet on the path, but you're able to run The first thing that comes to mind - since you installed .net7, have you entirely killed and restarted code-server? If not I would suggest trying that. |
I don't know how to kill and restart the code-server, but I just restarted both my mac (host) and my linux machine (remote). I get the same error: C# logs: https://gist.github.com/landonwilkins/160670a3f7c8de75feef0d21346f303e C# LSP logs: https://gist.github.com/landonwilkins/4c407dcb9a97f55cfd0580ad32f7702a |
This worked for me:
Just in case, before this but it had not worked for me, I used the script that automatically installs everything I leave the link: https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh Check this too: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#manual-install |
Good day everyone I encountered the same issue but none of the solutions above worked for me. I am using a Windows Host and the Remote SSH option to connect to a Debian Linux machine. We are using the dotnet-install script too, so we have dotnet installed in the default At some point I connected to the machine using SSH to verify that the command to kill the remote server actually works. That's when I recognized that the terminal has no colors, also dotnet is not available and So, turns out that the
After a quick test with a new ssh connection from my windows terminal everything is now properly set up. And VSCode is also happy. Here's the output of the C# extension:
It immediately started to work for me. Hope this helps you too. Cheers |
I tried both of the solutions above
After resetting all the settings, I saw the following in the logs:
So I restarted my remote, hoping I could get it working, but it still says "No .NET SDKS were found": https://gist.github.com/landonwilkins/fd24980336ad79577e86edbe70ed14c0 |
Have you restartet the ssh connection? A colleague of mine also used the command to kill the remote server first. That solved it for her. Tough your problem might be something else, sorry.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Landon Wilkins ***@***.***>
Sent: Saturday, September 16, 2023 4:58:24 PM
To: dotnet/vscode-csharp ***@***.***>
Cc: Christoph Lipp ***@***.***>; Comment ***@***.***>
Subject: Re: [dotnet/vscode-csharp] The .NET Core SDK cannot be located - Linux (Debian) (Issue #6179)
You don't often get email from ***@***.*** Learn why this is important<https://aka.ms/LearnAboutSenderIdentification>
I tried both of the solutions above
1. I tried adding the ~/.bash_profile bit
2. I tried uninstalling the dotnet installed by dotnet-install script, and reinstalling using BrianX340<https://github.com/BrianX340>'s method
3. I tried resetting all the settings
After resetting all the settings, I saw the following in the logs:
ms-dotnettools.csharp requested to download the .NET Runtime.
Downloading .NET version(s) 7.0.11 ...... Done!
.NET 7.0.11 executable path: /usr/local/google/home/landonwilkins/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.11/dotnet
So I restarted my remote, hoping I could get it working, but it still says "No .NET SDKS were found": https://gist.github.com/landonwilkins/fd24980336ad79577e86edbe70ed14c0
—
Reply to this email directly, view it on GitHub<#6179 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BBYODMSBHRHZELI3XGN5CNLX2W5BBANCNFSM6AAAAAA3WY6EAI>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Coming back to this after a while. Did some testing today and experienced the same issue and fix as mdd-lipp; adding the dotnet installation to the $PATH in Unfortunately I'm not sure if there is anything else I can do to help fix this from the extension side. The error:
means that dotnet is not found on the $PATH, so whatever shell is launching the vscode-server process on the remote machine doesn't have dotnet included in $PATH. And even if we download a local runtime to start the server, we'll still fail later on when we try to load the project because we can't find an SDK, as you see with these logs
No idea if this will work - but you could try and find what the $PATH is for the server process and symlink the dotnet executable into a folder that is part of that path.
Then to find the environment variables for the running process:
|
Impossible to use the SDK I have install sdk 8 and runtime 8 and aspnetcore 8 on my linux I'm on fedora workstation 39 thanks for help |
As stated on the wiki, launching VSCode from the Terminal resolves the error dialog. |
Closing this issue, there isn't a lot we can do on the extension side - dotnet must be installed and available on the $path. See the link above for troubleshooting dotnet availability on the path. |
In case anyone else ends up here, I had the same issue. Originally I had installed vscode from a flatpack, but when I updated it, it downloaded a .deb instead. The flatpack version had the problem where it couldn't locate the SDK, but the version installed from the .deb worked perfectly fine. |
@ybrdev answer helped me, running from terminal resolved the issue. I'm on Arch Linux and I have zsh as default shell setup both on system level and in vs code profile, I have all dotnet related env variables setup properly in .zshrc, but for some reason when I run vs code not from the terminal it uses /bin/sh to run tasks instead of zsh. |
Type: Bug
Issue Description
I've installed dotnet using the dotnet installer script: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
I've verified dotnet is installed
which dotnet
: /usr/local/google/home/landonwilkins/.dotnet/dotnetSteps to Reproduce
Expected Behavior
Actual Behavior
Logs
C# log
C# LSP Trace Logs
Environment information
VSCode version: 1.81.1
C# Extension: 2.0.376
Using OmniSharp: false
Dotnet Information
Host:
Version: 7.0.10
Architecture: x64
Commit: a6dbb800a4
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.NETCore.App 7.0.10 [/usr/local/google/home/landonwilkins/.vscode-server/data/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet/7.0.10/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/download
Visual Studio Code Extensions
Extension version: 2.0.376
VS Code version: Code 1.81.1 (Universal) (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:20:33.924Z)
OS version: Darwin arm64 22.6.0
Modes:
Remote OS version: Linux x64 6.3.11-1rodete1-amd64
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: