Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Visual Studio stopped recognizing Unity

Discussion in 'Scripting' started by Cosmology27, Mar 15, 2022.

  1. Cosmology27

    Cosmology27

    Joined:
    Jul 11, 2019
    Posts:
    61
    I have been working on a project, and as always Visual Studio and Unity work amazing together. I did not do any updates, or anything at all. I was in the middle of working on a project, and when I went back to my code again, everything had red underlines, and Visual Studio was saying that Unity isn't set up to work with Visual Studio, and that I should go to preferences in Unity and change this.
    I went to preferences in Unity and it is still set up the way I've always had it, and says Visual Studio is connected. I chose it again, just to be sure, and it reloaded stuff. I closed everything down, opened it all back up, and it's still not working.
    How do I get Visual Studio and Unity talking to each other again?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,522
    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:

    https://forum.unity.com/threads/intellisense-not-working-with-visual-studio-fix.836599/

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

    Also, this: https://forum.unity.com/threads/no-suggestions-in-vscode.955197/#post-6227874
     
    Cosmology27 likes this.