.NET SDK Not Found After Opening 2nd Unity Project

Mac user here (Ventura 13.5.2), using Unity versions 2019.4.29 and 2020.3.43. Has anyone experienced VSCode being unable to find the .NET SDK installation after opening a second Unity project? Everything works perfectly fine in the first project, but when I open a second one, suddenly the IntelliSense stops working and errors aren’t being detected. I’ve tried regenerating the .csproj files, re-running dotnet restore, and refreshing the problematic window countless times. The only difference I’ve noticed in the C# Dev Kit logs is that the working window uses the preinstalled .NET runtime whereas the problematic one uses a local runtime.

9417461--1319378--upload_2023-10-18_16-9-0.png

Here’s the output I get when I run dotnet --info:
9417461--1319381--MicrosoftTeams-image (113).png

Extensions:

  • C# v2.7.25
  • C# Dev Kit v1.0.4
  • Unity v0.9.2
  • .NET Runtime Install Tool v1.8.1

Update: I ran the three commands below at the command palette and the “Projects” number is stuck at the loading icon.
9417461--1319402--upload_2023-10-18_17-3-21.png

VSCode integration with Unity is finicky at best, and this goes for VSCode in general too because it depends so heavily on numerous plugins in combination with .Net and Unity versions (means: combinatory explosion of potential compatibility issues).

I keep recommending to absolutely NOT use VSCode if you value your time. VSCommunity is available on Mac too.

Visual Studio for Mac is going away next year, it’s not a viable long-term solution.

If using the preview Unity extension developed by Microsoft, it would be best to flag them to try and get things fixed for everyone (report them in Visual Studio Code as described here ).

2 Likes

I did not mention that because I’m not sure if that supports older Unity versions. I vaguely remember this is only for 2021+.

Hi @asaste0610 , yes we are aware of this. After investigating, we were able to link this behavior to a PATH expansion bug when VSCode creates subprocesses on macOS.

The issue is tracked here:
https://github.com/microsoft/vscode/issues/194736

Regards

We started with 2021+ but extended our support to 2019+.

1 Like

Thanks for pointing me towards an issue tracker – a couple of my colleagues have been dealing with the same problem. It’s not a huge inconvenience but very frustrating to constantly quit out of VSCode to navigate between projects.