VS Code error C# and .NET Core (section 1)

I have installed the C# and Unity Extension as mentioned in the first section of this course… however, whenever I open a script through Unity I get these following messages

It seems to work fine in Unity itself… though it bugs me that I have to click them away everytime I open a script…

Anyone know how I can fix this? (I tried installing the .NET Core SDK like the message is telling me, but it didn’t fix it)

Hi Xavvey,

Please try to download the .NET Core SDK from the official Microsoft website. Maybe the button brought you to the wrong SDK.


See also:

1 Like

What platform are you on?

Hmm guess the button was indeed for a wrong SDK. The link you provided seems to have solved the ‘SDK cannot be located’ error.

I do still keep getting this one:

Clicking the ‘Show Output’ button gives me this:

        Loading project: c:\Users\Xavier\Documents\UnityProjects\Obstacle Course\Assembly-CSharp.csproj
[fail]: OmniSharp.MSBuild.ProjectLoader
        The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'c:\Users\Xavier\Documents\UnityProjects\Obstacle Course\Assembly-CSharp.csproj'.
c:\Users\Xavier\Documents\UnityProjects\Obstacle Course\Assembly-CSharp.csproj
c:\Users\Xavier\.vscode\extensions\ms-dotnettools.csharp-1.23.9\.omnisharp\1.37.8-beta.15\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1216,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: c:\Users\Xavier\Documents\UnityProjects\Obstacle Course\Assembly-CSharp.csproj
1 Like

I’m on Windows using VS Code, if that is what you mean?

I also found out that this stopped Intellisense from working… I check different forums and tried a couple of options but no succes there either. I changed the TargetFrameworkVersion in the .csproj file to my current .net verion (5.0.201), that didn’t work. I changed a couple of settings in OmniPath, but that also didn’t work…

Hi @Xavvey, yes that is what I meant. I had the same warning with the yellow triangle on a Mac but it was because Macs need Mono-project to be installed.

I have come across that on another forum somewhere. What exactly is Mono? Is nothing else helps, then I will try that at least.

I’m a beginner in all this myself, but as far as I know it’s another C# framework and it’s something that helps things run on Mac.

Have a read on the link above.

@Rory_B This wasn’t the answer for me, I’m afraid. Installed Mono but the problem still is there. Thanks for the tip though!

Tries another (2018 solution) to install an older verion of the C# extension (1.15.2) but that didn’t work either. This seems like a very old and persistent problem where people encountering this can’t seem to get the autocomplete/intellisense to start working with unity/C#… And it also seems that everyone has another solution to the problem, but those don’t seem to work in 2021… Or at least with me :sweat_smile:

Guess I’ll have to do this course without autocomplete/intellisense enabled. Looking at it from the positive side… Now I have to git gud at reading the Unity Documents… I can’t go and see what the autocomplete gives me…

The problem with the .NET Core SDK is solved, isn’t it? If so, I assume the remaining problem is “The reference assemblies for .NETFramework,Version=v4.7.1 were not found”.

If so, install the .NET Framework 4.8 Developer Pack.

In Unity, go to Edit > Project Settings > Player > Other Settings. What Api Compatibility Level is selected? And what Scripting Backend?

Hi Nina,

Yes, The .NET Core SDK issue is resolved. Thanks for that!

The other issue is still there.

API compatibillity is set to .NET Standard 2.0
Scripting Backend is set to Mono

I was having similar issues and it sounds like we found a lot of the same posts when searching for help. I did manage to fix my issues by installing VS 2019 Build Tools: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16

This is the thread I followed which got me to the fix. filipw is the person who posted the fix if you want to read through it: https://github.com/OmniSharp/omnisharp-vscode/issues/4340

Once I installed that and rebooted, the autocomplete/intellisense started working for me. Hope this helps.

2 Likes

This worked like a charm! :smiley:

Had to get the .NET 4.7.1 version like mentioned by filipw in the forum. After re-opening VS Code intellisense kickec in and autocomplete works!

Thanks a lot @systemeffect!!!

1 Like

Awesome! I found that thread right after I looked at this one, I had a feeling it might work for you too. Glad it did!

Guess I just missed this one answer amongt the dozens of other ones… Seeing as it is a problem that dates back all the way to 2018 (maybe longer)… they really should get that sorted…

Anyway, thanks a billion!

Thanks a lot for sharing your solution, @systemeffect ! :slight_smile:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms