Visual Studio Intellisense not showing some classes
Asked Answered
L

8

6

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:

  • Restarting Visual Studio (With and without closing tabs)
  • Deleting the contents of %LocalAppData%\Microsoft\VisualStudio\14.0\ComponentCacheModel folder
  • Resetting import and export settings
Lehman answered 3/5, 2016 at 21:57 Comment(3)
Texture2D and Rectangle are in the Microsoft.Xna.Framework.Graphics namespace. So you'll certainly need more than one using directive.Stentor
@HansPassant The problem is right from there. It doesn't detect any directives other than SystemLehman
Not a single answer given below worked for me :(Lashay
L
0

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).

Lehman answered 2/6, 2016 at 15:0 Comment(0)
B
20

What worked for me is unloading and reloading the project

Bunkmate answered 16/9, 2016 at 12:11 Comment(3)
In my case this also worked, unloading and reloading the assembly where the new class was added that is.Hun
This worked for me on VS2017 just now; I had an MVC app and a class library that weren't recognising each other in intellisense (although everything compiled OK). Unloading a reloading both projects resolved the problem.Bittersweet
Worked for me disabling CodeLens first, then unloading and reloading the offending projects.Cuffs
A
7

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.

Angst answered 11/7, 2018 at 18:39 Comment(1)
this worked for me after intellisense stopped working in monogame shared project - thanksLamoree
U
2

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.
Urbana answered 5/9, 2018 at 3:56 Comment(0)
G
1

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.

Genesia answered 3/5, 2016 at 22:36 Comment(1)
The only third party thing u have installed is Monogame.Lehman
R
0

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.

Remembrancer answered 3/5, 2016 at 21:59 Comment(1)
Yea this did not work. Also I just added things I've tried.Lehman
L
0

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).

Lehman answered 2/6, 2016 at 15:0 Comment(0)
C
0

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))

Chockablock answered 8/9, 2018 at 23:18 Comment(0)
D
0

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

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

Deedeeann answered 20/6, 2021 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.