In visual studio..a red line appears under the code even if it is true code

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. :slight_smile:


See also;