Visual Studio Code Error: The .Net Core cannot be located

Hello everyone.

I am pretty early in the Udemy course and upon downloading Visual Code I encountered this error:

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.

It then prompts me to “Get the SDK”.

I clicked on the link already which forwarded me to the Download .NET 5.0 file, which I have. I downloaded and installed the file for my Mac, and yet I still receive this error despite downloading the file it prompted me to download. Can someone help?

Hi,

Do you use Visual Studio or Visual Studio Code? They are two different script editors.

Please follow the instruction on this website and make sure all required extensions are installed: https://code.visualstudio.com/docs/other/unity

If the issue persists, please check the console of VS Code (not Unity!). If the .NET Framework 4.7.1 (Developer Pack) is mentioned there, download and install it from the official Microsoft. Here is the link: https://dotnet.microsoft.com/download/dotnet-framework/net471

Depending on your version of Unity, it might be that you will have to install the “Visual Studio Code Editor” package in Window > Package Manager in Unity.

Maybe you’ll have to reboot your computer. Then launch Unity again and open one of your scripts.

Did this help you fix the issue?


See also:

Hello!

I am using Visual Studio Code. I no longer get the error:

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.

However I am still told that:

Some projects have trouble loading. Please review the output for more details.

Here is what it says inside the output:

Error: This project targets .NET version that requires reference assemblies that do not ship with OmniSharp out of the box (e.g. .NET Framework). The most common solution is to make sure Mono is installed on your machine (https://mono-project.com/download/) and that OmniSharp is started with that Mono installation (e.g. “omnisharp.useGlobalMono”:“always” in C# Extension for VS Code).
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /Users/bryanpham/Documents/Unity/Complete C# Unity Developer 2D Course/Section 2/Delivery Driver/Delivery Driver/Assembly-CSharp.csproj

I have already downloaded and installed the mono framework as per your instructions (Visual Studio Code and Unity).

How do I check the debug console of VS Code to see if the .Net Framework 4.7.1 appears? It debug console is empty for me. Unless you are talking about the Output tab. In that case, only the above error mentions anything about .NET, nothing specific towards NET Framework 4.7.1. Do I have to install it anyways even though I installed 5.0?

Hello - just wondering - I have a problem where the autocomplete isn’t exactly filling out like it does in the lecture videos I see. For example, it Rick’s video, when he types “GetComponent” or something, the dropdown menu/ autocomplete thing appears.

For me though a completely different menu appears, or just doesnt appear at all. Im assuming my initial issue with the .NET framework is directly responsible for this?

That’s very likely the case. Actually, the console in Visual Studio Code (not Unity!) should mention the missing framework somewhere.

Maybe you’ll have to reinstall VS Code to make the .NET framework work properly.

If nothing helps, please install and use Visual Studio (Community Edition). Select it as your External Script Editor in Unity (Edit > Preferences > External Tools). And make sure that the “Visual Studio Editor” package is installed in the Unity Package Manager.

Hello Nina,

Only the above error message is shown in the console of Visual Studio Code. And again, I would like to ask if the Output tab is what you are referring to when you say “Console”. Or is it the Debug Console? If it is the Output tab, then yes, only the above error message mentions the .Net framework.

I also did some digging. On the C# extension, it mentions this:

For MacOS and Linux users who have Mono installed, this means you will need to set omnisharp.useGlobalMono to never until a version of Mono ships with MSBuild 16.7.

Maybe this is the issue? I think the omnisharp.useGlobalMono is set to “always” when in fact I have to set it to “never”?? I am only guessing here.

How do I check? How do I set this to never?

Yes, that’s the console I’m referring to.

As the console says, you can set “omnisharp.useGlobalMono” to “always” or “never” in the settings of the C# Extension plugin. There is a search field at the top of VS Code. Try to type omnisharp there to see what happens.

According to the message, you need toh ave the MONO framework installed.

So i disabled Omnisharp to never and I still get the same error.

I don’t know if that did anything?

I do have Mono framework installed already - I did so immediately after I read your first reply, but I can reinstall it again if you think that will help.

For some students, uninstalling both the MONO framework and VS Code helps. Then they install the MONO Framework, reboot their computer, install VS Code and reboot again.

You could also try this:

  1. Press Ctrl + Shift + P.
  2. Type “OmniSharp: Select Project” and press Enter.
  3. Select the solution workspace entry.

This topic was automatically closed after 32 hours. New replies are no longer allowed.

Privacy & Terms