Visual Studio Not Showing Multiple Unity-Related Features

I have been using Unity both freehand and following along with Unity’s Junior Programmers Tutorial, using Visual Studio as my IDE of choice. When I create a C# script for one of my own projects and open it in Visual Studio, the IDE will not show me error squiggles, autocomplete, code suggestions, information about methods, or color any of the Unity-specific data types and methods. However, when I create a C# script for one of projects for the Junior Programmer Tutorial, it shows all of these things no problem. I am not sure why it works on one project but not the other.

Visual Studio was just downloaded on this computer, so I know it’s the most recent version. I also downloaded the Unity and C# packages that came along with it at installation.

Below are two screenshots showing the differing issues. I copied the exact same start function from one script over to the other. The first image does not show proper colors, error squiggles, coloration, etc. but the second one does. These were opened in Visual Studio simultaneously. What can I do to fix this issue?





This may help you with intellisense and possibly other Visual Studio integration problems:

Sometimes the fix is as simple as doing Assets → Open C# Project from Unity. Other times it requires more.

Other times it requires you also nuke the userprefs and .vsconfig and other crufty low-value high-hassle files that Visual Studio tends to slowly damage over time, then try the above trick.

Barring all that, move on to other ideas:

Also, try update the package inside of Unity: Window → Package Manager → Search for Visual Studio Editor → Press the Update button

Depending on flavor and version of Visual Studio, it may also have an installation step that you perform within the actual Visual Studio. This step seems finicky at best and may require multiple openings of VS before it comes up.

Update: The VSCode extension has been deprecated and abandoned:

Update: the VSCode integration is back… maybe!?

There may be a community fork available that is receiving updates.

Also, this: No suggestions in Vscode

Recently (July 2023) I worked on a Windows11 system that required a Microsoft component to be installed from within Visual Studio before it would work properly with all the OTHER software installed under Unity. I have no documentation on that process as I have only seen it once and it surprised me as well.