Johannes Forsting
Johannes Forsting

Reputation: 9

Why does Visual Studio 2022 suddenly stop showing errors?

As stated in the headline, Visual Studio 2022 suddenly stopped showing errors (and also I can't find public method and variables but that's another question).

enter image description here

I am working in Unity and suddenly it just don't want to cooperate anymore.

I tried closing the application and unity all together and restarted my computer, and nothing worked.

Upvotes: 0

Views: 430

Answers (1)

Drew Noakes
Drew Noakes

Reputation: 310852

At the top of your screenshot you can see "Miscellaneous Files". This means that the file is not considered to be part of any project.

To see errors and IntelliSense, VS requires source files to exist within a project so that it knows:

  • What references exist (packages, assemblies, target framework)
  • What version of the language is being used
  • Various properties that influence analysis/analyzers

So for some reason your file is not considered part of a project. We can't see your Solution Explorer, so it's not clear why that might be. Most likely you've opened the file via "File | Open". Make sure you create the file within a project, or add it to a project.

Upvotes: 1

Related Questions