DSchana
DSchana

Reputation: 1038

Visual Studio Intellisense not showing some classes

My Visual Studio is not showing a lot of the available classes in the IntelliSense auto-complete. For example, a project I'm working on has a reference to the Microsoft.Xna.Framework namespace, yet even after adding the using statement using Microsoft.Xna.Framework in a file, IntelliSense is unable to recognize classes like Texture2D and Rectangle. I can still type them in, however, without getting a compiler error. Any idea what's happening?

The IntelliSense detects standard libraries like System.Diagnostics but not any external ones.

It is not a NameSpace conflict issue because classes within the current namespace are also missing from the IntelliSense.

I have tried:

Upvotes: 6

Views: 18523

Answers (8)

Ali Smadi
Ali Smadi

Reputation: 1

Click on the class not showing and Change Build Action -> to Compile

it happens sometimes when you add class as content or other resources

Upvotes: 0

cpllael
cpllael

Reputation: 61

another dumb solution))) Determine which classes/namespaces are not showing up. Then go to that project where they are. In that project pick any .cs file copy its contents, then delete that file and create again))

Upvotes: 0

Talha Ashfaque
Talha Ashfaque

Reputation: 4072

I am using ReSharper. What worked for me:

  1. Unload project.
  2. ReSharper > Options > Environment > General > Clear caches
  3. Close solution.
  4. Exit Visual Studio.
  5. Restart Visual Studio.
  6. Reload project.

Upvotes: 2

Jacob Stern
Jacob Stern

Reputation: 4587

If unloading/reloading the project doesn't work, try deleting the .suo file found in the SolutionName/.vs/ folder. The .vs folder is an auto-created, hidden folder so you will have to show hidden folders in order to see it.

Upvotes: 7

Johan
Johan

Reputation: 209

What worked for me is unloading and reloading the project

Upvotes: 20

DSchana
DSchana

Reputation: 1038

OK so probably not the best solution but it works. I reinstalled Visual Studio and the problem was fixed. Also, it hasn't shown up since (this happened about 3 months ago).

Upvotes: 0

Ryan Intravia
Ryan Intravia

Reputation: 420

Do you have ReSharper or any other plugins installed? There sounds like a similar issue/solution here. It may be third-party plugins at play depending on what add-ons you have.

Upvotes: 1

Joe
Joe

Reputation: 52

Try saving and reloading the files. I don't know why it happens, but it happens to my work laptop occasionally, typically reopening the source file resolves it.

Upvotes: 0

Related Questions