- Home /
Visual Studio is not recognizing Unity
I've deleted and redownloaded visual studio and Unity several times but the problem still persists. Visual Studio doesn't recognize
using System.Collections; using System.Collections.Generic; using UnityEngine;
Therefore nothing works
I currently have Unity version 2019.1.4f1. This problem started after Visual Studio update
"void" is part of the C# language, so I would guess that visual studio isn't recognising C# at all
Answer by JDelekto · May 26, 2019 at 01:40 PM
Which version of Visual Studio do you have installed? Did you install the Visual Studio Tools for Unity for that version? If not, either update your installation or go to Tools > Extensions & Updates in Visual Studio, search for and install the Visual Studio Tools for Unity.
Is this what your referring to
Visual Studio was installed by Unity 2019.1.4f1 so it should have the necessary tools
I was referring to Visual Studio, not "Visual Studio Code". They are two different IDEs. I am not sure if Unity integrates with Visual Studio Code; however, you can get a version of Visual Studio Community Edition (https://visualstudio.microsoft.com/vs/community/) that will work Unity with the correct add-in.
Others' have used Visual Studio Code (http://56gamestudios.com/blog/2017/06/getting-started-with-visual-studio-code/) with Unity to some success.
I can't find Extensions & Updates in the Tools dropdown.
Answer by datastep · Aug 01, 2021 at 01:02 AM
for those who cannot solve this problem using above solutions, try this.
Go to Edit -> Preferences -> External Tools
In the Generate .csproj files for: tab, make sure "Local packages" is checked
Click "Regenerate project files" button
This worked for me (unity version 2019.4)
Honestly, thank you so much ahaha, I was trying all the other fixes and this one worked!
Answer by RelativeTime · May 10, 2021 at 04:06 PM
If the issue persists after updating (or the editor is already updated beforehand) you can do the following as this worked for me after I updated my project with a new version.:
Close visual studio
In your project delete the following files (or copy them somewhere else for safekeeping): projectname.sln, Assembly-CSharp.csproj and .vsconfig
Restart visual studio by opening a script via the Unity editor (and this should recreate the just deleted files).
And yes, this is a "have you tried restarting it?" solution but often those work.
Answer by ReeseEifler · Apr 07, 2021 at 01:55 PM
Reinstalling the Visual Studio Editor package through Unity by "upgrading" to a previous version then upgrading again to the current version of the Visual Studio Editor package worked for me. This whole thing has happened to me on multiple computers.
This worked for me, thanks.
Visual Studio stopped recognizing unity for whatever reason, reinstalling unity tools in Visual Studio extensions didn't help, but this did.
Answer by Minoangelo · May 26, 2019 at 04:06 PM
I just had the same issue. Just check for new updates from within Visual Studio – It should show a new Mono Framework (or similar). After installing this update, it should work fine again :)