Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug .NET SDK Not Found After Opening 2nd Unity Project

Discussion in 'Code Editors & IDEs' started by asaste0610, Oct 18, 2023.

  1. asaste0610

    asaste0610

    Joined:
    Jul 14, 2021
    Posts:
    3
    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.

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

    Here's the output I get when I run dotnet --info:
    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.
    upload_2023-10-18_17-3-21.png
     
    Last edited: Oct 18, 2023
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,994
    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.
     
  3. Spy-Master

    Spy-Master

    Joined:
    Aug 4, 2022
    Posts:
    414
    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).
     
    asaste0610 and sailro like this.
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,994
    I did not mention that because I'm not sure if that supports older Unity versions. I vaguely remember this is only for 2021+.
     
  5. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    166
    Last edited: Oct 20, 2023
  6. sailro

    sailro

    Microsoft

    Joined:
    Jul 30, 2014
    Posts:
    166
    We started with 2021+ but extended our support to 2019+.
     
    asaste0610 likes this.
  7. asaste0610

    asaste0610

    Joined:
    Jul 14, 2021
    Posts:
    3
    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.