Unity and Visual studio keep losing each other

I guess they’re in a love-hate relationship.

Hello, welcome to hell.
Even since I got 2020.3.18.f1, my Unity keeps popping some errors with Visual Studio. It works a bit then displays a warning in VS “This unity project was not generated for the vs tools for unity…”. My Unity displayed something about a certain port not being accessible. Randomly, one of the scripts just “unloads” and doesn’t show “Assembly-CSharp” as what’s its using above the VS editor, but shows the default thing (idk at the moment, cause it works rn).
I tried relinking the external tools thingy, regenerating it as well, reinstalling VS tools, and usually a restart of everything fixes it, and then it either works all day, or again starts spamming something after 20 mins.

I can try and reinstall everything, or are there some things that I don’t I should try as well?

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.

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

Also, this: No suggestions in Vscode

1 Like