Hello Ahmed,
This behaviour occurs if Visual Studio only has the file open and not the solution/project. The reason for this is that it is the project file which contains all of the references to the libraries (.dlls) which the code relates to and which Visual Studio’s Intellisense relies on.
If you open Solution Explorer within Visual Studio I suspect you’ll find it’s empty.
Also, I note that you have a notification on the menu bar of Visual Studio, there was an issue in a previous version of Visual Studio which failed to reload the project file and individual files after they had been update within Unity - this also could cause the above behaviour.
You can find details regarding that specific issue below, but if you notification relates to an update for Visual Studio you would do well to update it.
Hope this helps.
See also;
- GameDevtv Community : Unity / Visual Studio 2017 not reloading project changes
Hello Rob,I just updated visual studio…the red lines didn’t change they are the same,i’m now repairing visual studio from the installer,hope this will solve the problem.
By the way I have two versions of visual studio on my computer,2015(i dont use it) and 2017 community which contains the problem
Hi Ahmed,
Could you copy/paste the full scripts into a reply please, and apply code formatting just so I can rule out anything like missing brackets/braces.
Regarding Visual Studio, having two versions installed shouldn’t be a problem, however, you will find that Unity will find an existing installation and not offer the 2017 Community edition on the install. If you are not using 2015, and have no plans to do so, personally I’d probably just uninstall it and keep the latest version of the Community edition installed.
See also;
- Forum User Guides : How to apply code formatting within your post