-
Notifications
You must be signed in to change notification settings - Fork 676
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 #3401
Comments
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. 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 Update 2: It was strictly a VSCodium issue, works fine in VSCode. |
Environment
ReferenceOmniSharp/omnisharp-vscode Wiki
My SolutionExit VSCode and open it... ReasonI try not to exit vscode on my mac when it's connected to a monitor because vscode has some |
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 |
@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 |
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 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. I have no problems using the .net5 RC1 on Fedora 33 beta. Download the dotnet-sdk SDK manually. Start VSCode with a script file with this content: where you have to adapt XXX and YYY to your case. DO NOT USE Ubuntu snap. From my console: xxx:~$ dotnet Usage: dotnet [options] Options: path-to-application: 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: sudo snap install dotnet-sdk --channel=5.0/beta --classic DO NOT install the alias because it makes Omnisharp not find the SDK. It can be removed with: Start VSCode with a script file with this content: 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, |
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. |
I had to uninstall the dotnet-sdk (5.0), which I had previously installed via snap
|
This morning my VSCode updated (on Linux Mint 21). When it updated, several packages were updated also including the SDK. (I am using apt, not snap). After opening VSCode, the command How do I get VSCode to recognize the SDK? Or, if I have to, roll back the update? |
For me, in linux system, moving these variables from
It looks like vscode doesn't load variables from |
Installation If you run into issues, please check your distro's required dependencies here:
or Just download and extract to ~/.dotnet from https://dotnet.microsoft.com/en-us/download/dotnet/8.0 Now, vscode needs to be able to find just the dotnet binary at /usr/share/dotnet else you will get an error. Let's go ahead and create a soft link
Optionally copy the directory to the /usr/share/dotnet path for multi-user support when provisioning.
You will want to create the export regardless, especially the tools path, since you'll want to install some nugpkgs. You can create your dotnet alias and tools export on either ~/.bashrc or ~/.zshrc (Yes, an alias, since the soft link will always assume priority, and you will have workload installs going to the root user instead of your own user - among other nupkg breaks and repairs)
Finally, save the file and source it so you don't have to logout/reboot Optionally append the following exports for multi-user provisioning at /etc/profile.local (don't edit /etc/profile - changes will be lost after updates/upgrades). Reboot once done for the changes to take effect.
.Net Uninstall Tool https://github.com/dotnet/cli-lab/releases Testing! I 100% recommend test-driving it with the following two quick projects: https://dotnet.microsoft.com/en-us/learn/dotnet/hello-world-tutorial/intro BONUS: Testing with the OpenSource MonoGame Framework! (A Microsoft XNA Fork)
Up to this point, you should be able to launch the asset/content builder mgcb-editor just for testing purposes from inside the root of the project folder we just created:
Now, let's pretend we are publishing: Launch the game You should get an empty game canvas from the monogame framework running. If your project or environment gets messed up at any point, restore it. Reference: https://monogame.net/articles/getting_started/1_setting_up_your_development_environment_unix/ Happy Coding! and/or Automated provisioning! |
Environment data
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
Steps to reproduce
Expected behavior
VScode find .net core sdk
Actual behavior
VScode can't find .net core sdk but i installed it
The text was updated successfully, but these errors were encountered: