4

I'm using Ubuntu 20.04 (64 bit, desktop) and just installed VS Code and .NET Core SDK.

Intellisense does not work and I get that error message:

The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path.

I reinstalled the .NET Core SDK (from the SnapStore) and made sure that VS Code is not open while installing it.

After that I could use intellisense for about 5 seconds, then the error appeared again and intellisense stopped working.

EDIT: When using the scripted intall as "Ben" mentioned, i get this result:

dotnet-install: Note that the intended use of this script is for Continuous Integration (CI) scenarios, where: dotnet-install: - The SDK needs to be installed without user interaction and without admin rights. dotnet-install: - The SDK installation doesn't need to persist across multiple CI runs. dotnet-install: To set up a development environment or to run apps, use installers rather than this script. Visit https://dotnet.microsoft.com/download to get the installer.

dotnet-install: .NET Core SDK version 3.1.409 is already installed. dotnet-install: Adding to current process PATH: /home/MYUSERNAME/.dotnet. Note: This change will be visible only when sourcing script. dotnet-install: Note that the script does not resolve dependencies during installation. dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section. dotnet-install: Installation finished successfully.

AlpakaJoe
  • 533
  • 5
  • 24

4 Answers4

3
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet 

worked for me from this answer: https://stackoverflow.com/a/66429089/16969349

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 29 '21 at 12:45
0

I wouldn't use the .NET SDK from snap, since snap "apps" run in a containerized environment, which makes it much harder for other apps to be able to find them. Have you tried installing using Microsoft's guide? I would recommend using the scripted install

Ben
  • 394
  • 7
  • 13
  • I uninstalled the snap SDK and tried to use the scripted install, but it gives me an "error" that i added to my original post. – AlpakaJoe May 18 '21 at 06:39
0

im using ubuntu Ubuntu 22.04.2 run dotnet --list-sdks to see where your sdks are installed. In my case i got the foolowing output

path to dotnet sdk

go to file, preferences, settings in visual studio code, search for onmisharp dotnet path update update Dot Net Cli Paths and dotnet path using the paths where your sdk is istalled

-2

I had the same problem what I did is

  1. uninstall all of the services that belong to Visual Studio(not Vs Code)
  2. uninstall VS Code and folder "AppData\Local\Programs\Microsoft VS Code
  3. download new dotnet core SDK and install vs code.
Kashyap
  • 48
  • 3