0

I am having a problem with IntelliSense in my VS 2017. When I miss some using statement, I receive an error and no suggestions:

Here is an example:

enter image description here

I have a class called Profile, but I am not seeing any error or any suggestion. Can anybody help me with that?

Nisarg Shah
  • 14,151
  • 6
  • 34
  • 55
Samy Sammour
  • 2,298
  • 2
  • 31
  • 66
  • 3
    "I receive an Error" what error? – Fildor Sep 01 '17 at 08:50
  • Where is the `Profile` class located? – Jerodev Sep 01 '17 at 08:53
  • I mean Error in Text Editor. Normally (before) it will put a red line under the Profile and suggest the namespace. but I am not seeing this functionality now – Samy Sammour Sep 01 '17 at 08:58
  • Well, what namespace is `Profile` in? – Fildor Sep 01 '17 at 09:07
  • namespace Models. But why I am not receiving the suggestion of the name space and I was receiving it before – Samy Sammour Sep 01 '17 at 09:12
  • If you forget to add the correct project or assembly reference, Intellisense won't be able to propose a namespace. Another reason is that the *other* project fails to compile. In this case you can search for the type or member with `Ctrl + T`. Type `t Profile` to search for the `Profile` type, `m SomeMethod` to search for a member etc – Panagiotis Kanavos Sep 01 '17 at 09:32
  • I did before. if I add using Models; everything is okay and profile will be found. But this is not my question. Why my IntelliSense does not detect my missing namespace and does not show a red line under the "Profile" – Samy Sammour Sep 01 '17 at 09:37
  • 2
    @SamySammour the suggestion doesn't come from *Intellisense*, it comes from Roslyn's analyzers. As for a specific why - I can't say without the actual code. In previous versions such suggestions were **ONLY** provided by ReSharper. VS 2017 allows analyzers to propose suggestions which may or may not work as well as Resharper. Which Update have you installed? The latest is Update 3, version 15.3.3 – Panagiotis Kanavos Sep 01 '17 at 09:41
  • Ooh, wow this is very good. my version is 15.3.1 and I have added it correctly. I guess the problem is, that it is somehow disabled. because it was working – Samy Sammour Sep 01 '17 at 10:42

1 Answers1

0

I would suggest to install 'Visual Studio Productivity Power Tools' by going to Tools -> Extensions and Updates -> Online, and searching for it by name. I'm running this on a very old PC, and it doesn't really drain performance.

You can also try the series of solutions proposed by SajjadHashmi here to fix a broken IntelliSense.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
H35am
  • 768
  • 2
  • 12
  • 32
  • This should be a *comment* since it doesn't answer the question. You don't need any extensions to search by name either, just hit `Ctrl + T`. Finally, neither search nor Intellisense will work for a *missing* reference – Panagiotis Kanavos Sep 01 '17 at 09:28
  • 1
    Please read the question, I'm just answering by pointing to a solution also I'm sharing my experience, BTW hitting `ctrl+T` will maybe do something else if you have different keybindings. – H35am Sep 01 '17 at 09:38
  • I've read and understood the question. This doesn't answer it. It doesn't explain why Intellisense isn't working or how to fix this. It proposes the use of search instead. It should be a comment at best – Panagiotis Kanavos Sep 01 '17 at 09:39
  • That's why you can also find a link to SajjadHashmi solution, unnecessary to repeat it again here. – H35am Sep 01 '17 at 09:43
  • Besides, the question isn't even about a problem with Intellisense. The OP asks why there is no suggestion to add the missing namespace. This won't be fixed by searching – Panagiotis Kanavos Sep 01 '17 at 09:43
  • 1
    As for the linked answer, you should have posted this in a comment, or vote to close as duplicate. Not that it would work - that's a solution for Visual Studio 2012. The paths are wrong, and VS has changed a LOT since then. Again, the OP asks about the suggestion to add a namespace. This won't be fixed by searching or clearing the cache – Panagiotis Kanavos Sep 01 '17 at 09:45
  • Ok thank you for clearing this out, if you want we can join a chatroom to discuss about this, otherwise this comment getting long :) – H35am Sep 01 '17 at 09:47