dotnet --info output:
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
Host (useful for support):
Version: 3.0.0
Commit: 95a0a61858
.NET Core SDKs installed:
No SDKs were found.
.NET Core runtimes installed:
Microsoft.NETCore.App 3.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
VS Code version:
1.40
C# Extension version:
1.21.6
VScode find .net core sdk
VScode can't find .net core sdk but i installed it

Same thing when using 1.21.7
The net core 3.0-rc1 sdk works perfectly fine: https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.0.100-rc1-windows-x64-installer
Failed to install
Please, don't install the 3.0-rc1 SDK -- that is an outdated release candidate.
@GhostShot3 the output you have from above indicates that the C# extension is working correctly - you don't have a .NET SDK installed, just a .NET runtime. Did you install an SDK? Here is the current install link from https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install
Yes i install i tryed and say already installed
Can you try uninstalling it and reinstalling it? I suspect something went wrong with the first install.
Worked, thank you
Just wanted to chime in and say I saw the same problem, with the same resolution.
In my case, I uninstalled several things (.NET Core 2.2.7, .NET Core 3.0, NuGet, Mono) and reinstalled just the .NET Core 3.0. That seemed to resolve the problem.
It looks like VSCode was picking up the MSBuild/etc. from the Mono folder (mine was Mono 6.0 for some reason), but anyway, reinstall for the win.
(I'm on Linux if that matters)
I have this problem when starting VSCodium with drun.
Starting VSCodium from zsh and it works as expected.
Can anyone explain what the different in these two methods could be? Something related to paths I imagine.
Update: Actually, I do get what I expected from dotnet --info when running that in a terminal.
And if I have one instance of VSCodium open that I started from terminal. Any extra instances I open with drun now works.
Update 2: It was strictly a VSCodium issue, works fine in VSCode.
3.11.21.9OmniSharp/omnisharp-vscode Wiki
If you had Visual Studio Code open at the time you installed the .NET SDK, and you haven't restarted it, you should do so.
Exit VSCode and open it...
I try not to exit vscode on my mac when it's connected to a monitor because vscode has some
GPU rendering problem in this circumstances. This habbit leads to the problems.
Also note, if you are installing .net sdk on a platform where we do not provide an installer or where you want to automate the installation. The dotnet-install script should configure everything necessary. https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
This issue pops up on Ubuntu 20.04 following both links above, when installing using APT, snap or the script cited. I can run which dotnet and verify the sdk binary is in PATH, but when opening vs code from the same terminal session using code . it still throws the errors around the missing SDK.
@JackTiber In case you haven't already read this: https://github.com/OmniSharp/omnisharp-vscode/wiki/Troubleshooting:-'The-.NET-Core-SDK-cannot-be-located.'-errors
This issue isn't a problem with this extension -- this is either a problem with VS Code, or with your shell. There is instructions in there on debugging VS Code if you are so inclined.
@gregg-miskelly thanks for the link! So oddly, that did help with VS Code popup regarding a missing SDK, but then in the actual output logs of the Omnisharp plugin's language server, it still fails to find an SDK binary to use. Originally, I had the sdk installed via APT, but most recently used SNAP to see if that worked.
At this point, I am going to do a full wipe of the machine and start from scratch, to also support a couple of hardware updates I am making. Will check back in either way, but definitely a lot of issues installing it on LTS versions of Ubuntu.
If there's still people having this issue then try this:
now in my case I had 2 C:\Program Files (x86)\dotnet\ and C:\Program Files\dotnet\ if you actually go to the folders you'll notice that there's no sdk folder within the C:\Program Files (x86)\dotnet\ folder. So simply select C:\Program Files\dotnet\ and click the "move up" button. Then click OK all the way out of there, now try and see if things are working..
I basically just had to restart my pc after installing the .NET sdk. Then it all worked! I guess some changes (env variables?) needed a reboot.
@JackTiber Where you able to solve your issue? I'm having the same problem and wondering if going nuclear is my only option at this point. Thanks.
@Drexlin I did. At the end of the day, the best method I found was to remove any trace of the SDK (snap especially which can have even more issues than installing via APT in the docs) and then re-installing using APT. Once it is installed, verify that you can get the binary on your path with which dotnet, but do not try to use it yet. Restart your machine, which I recommend actually shutting down completely and then bringing it back up. At that point, it started working for me.
The link @gregg-miskelly provided is pretty helpful in detailing the troubleshooting steps.
Honestly, if I had to guess this probably has something to do with where the binary is installed on Debian based systems and the spawned shell for the extension / VS Code, which is somehow why the restart makes a difference. Some environment variable that isn't set after installation is probably set during startup and fixes the issue. Recently worked with a Fedora 32 machine and had all of 0 problems getting the SDK installed and working with the extension and code.
@JackTiber Thanks, I will try that. If I can't get it to work, maybe I'll give CentOS a try.
@Drexlin @JackTiber @gregg-miskelly
I made this post already here and here.
DO NOT USE Ubuntu.
Not even the Binary file from https://dotnet.microsoft.com/download/dotnet/5.0 works because the dotnet executable is not recognized on Ubuntu. I guess it is related to dotnet-sdk on snap on Ubuntu.
I have no problems using the .net5 RC1 on Fedora 33 beta.
1)
Download the dotnet-sdk SDK manually.
I have downloaded the Binaries from https://dotnet.microsoft.com/download/dotnet/5.0
No package manager.
2)
Start VSCode with a script file with this content:
export PATH=$PATH:/YYY/
/home/XXX/Downloads/VSCode/code-insiders
where you have to adapt XXX and YYY to your case.
YYY is the folder where you have stored the SDK.
DO NOT USE Ubuntu snap.
Someone working on snap dotnet-sdk must have introduced an automatic "dotnet" alias that is listed but can not be removed with the "sudo snap unalias dotnet" command because Error: "cannot find manual alias "dotnet" in any snap".
Unfortunately the people working on omnisharp do not care about this problem.
From my console:
xxx:~$ dotnet
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
xxx:~$ snap aliases
Befehl Alias Anmerkungen
dotnet-sdk.dotnet dotnet -
xxx:~$ sudo snap unalias dotnet
Fehler: cannot find manual alias "dotnet" in any snap
Previously:
I made this post already here and here.
On Ubuntu 20.04.1, the problem is the snap alias. Do not install it.
Instead do this:
1)
sudo snap install dotnet-sdk --channel=5.0/beta --classic
DO NOT install the alias because it makes Omnisharp not find the SDK.
sudo snap alias dotnet-sdk.dotnet dotnet
It can be removed with:
sudo snap unalias dotnet
2)
Start VSCode with a script file with this content:
export PATH=$PATH:/snap/dotnet-sdk/current/
/home/XXX/Downloads/VSCode/code-insiders
You have to adapt the second line, that starts VSCode insiders, to your case.
I was having the same problem. I changed the path of dotnet from the environment variables. After that, i restart the visual studio it works,
To do that,
Open My Computer
Right Click and go to properties
Go to Advanced System Properties
Go to Environment Variables
Find the path and select edit
Add new path if not exist,
C:\Program FIles\dotnet
If it's already their, then it might be other problems.
On linux, I have dotnet in my path and in common path /usr/bin/dotnet and the extension cannot find it.
Cara, uso Windows... No meu, l谩 nas Vari谩veis de Ambiente, por algum motivo estava vindo um ";" no inicio do diret贸rio do dotnet... Retirei, reiniciei o Visual S. C. e funcionou.
Most helpful comment
Environment
3.11.21.9Reference
OmniSharp/omnisharp-vscode Wiki
If you had Visual Studio Code open at the time you installed the .NET SDK, and you haven't restarted it, you should do so.My Solution
Exit VSCode and open it...
Reason
I try not to exit vscode on my mac when it's connected to a monitor because vscode has some
GPU rendering problem in this circumstances. This habbit leads to the problems.