Fartomy
Fartomy

Reputation: 9

VS Code (The .NET Core SDK cannot be located .NET Core) Error

I just installed Elementary OS as operating system. Then I installed Unity. I also installed VS Code as the script editor for Unity. Afterwards, I installed the .Net 5 and Mono 6 SDKs for Unity again, but when I entered VS Code, even though .Net was installed (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) error. I did a lot of research but couldn't find any solution. C# and Unity Debugger are installed as extensions. I'll be happy if you can help me. Thank you in advance.

Enter image description here

Upvotes: 1

Views: 3974

Answers (2)

Giuseppe Sposito
Giuseppe Sposito

Reputation: 11

I found the solution after days and days. I almost got mad!

Beside of the dotnet, mono and all the things that you have to install. Don't install VS code from FlatPak if you're using Ubuntu (I guess any Linux at this point) Install it from the original source code

In Unity go on Windows-> Package Manager -> Unity Registry and install Visual Studio Code Editor because Unity itself installs Visual Studio EDITOR. At the time that I'm writing that we have the version 1.2.5.

After that close everything, reopen it and MAGIC, you can set it up from your Edit->Preferences->External Editor!

Now, in order to check if everything is working perfectly. -Open Visual studio -Install Unity Debugger in extension ( I have the deprecated version and it works) -Close VS code -Open any script from unity

In VS code open the output console and on the right select OmniSharp Log OUTPUT OmniSharp If it's building things and doesn't create problems your VS code should work perfectly

I'm having only Received response for /v2/getcodeactions but could not find request. I'm sorting out that right now but it works anyway

Upvotes: 1

shuyan
shuyan

Reputation: 109

I tried https://stackoverflow.com/a/62748238 and it worked for me.

  1. close your vscode
  2. rm -rf $HOME/.dotnet
  3. reinstall dotnet again (and remember to close vscode before you install)

As for unity development I highly recommend rider on linux platform to debug unity script. I tried vs code and can't set breakpoint successfully.

Unity’s support for Visual Studio Code is experimental as Unity does not officially support the Debugger for Unity extension.

On windows I use visual studio(visual studio and vscode are two different IDE) to debug unity script.

Upvotes: 1

Related Questions