Lol, I had the same problem FOREVER! Here’s something that I did:
Make sure the newest version of Visual studio is installed. For me, when I changed from version 2020 to 2023 it gave me intelligence…
Unfortunately there doesn’t seem to be a package that allows you to do that.
Make sure when you install it though, you select any package you may need with visual studio, so when they prompt you to choose, I’d look at those boxes to see which to check.
When visual studio is reinstalled, go into Unity>Edit>Preferences and make sure the newest visual studio is the default setting
If that doesn’t work, then simply uninstalling and reinstalling Visual Studio might help
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 website. Here is the link: https://dotnet.microsoft.com/download/dotnet-framework/net471
Install and use Visual Studio (Community Edition). For some students, VS Code simply does not work well. Maybe due to a problem with Unity, some update or whatever.