1

Visual Studio 2015 not suggesting to include references when adding new type. For example, in the attached image, XmlDocument is not recognized and I have to include the proper reference manually (add using System.XmlDocument;) although the assembly (dll file) is added as reference. But, usually, VS provides a list of suggestions to include a reference or create new type.

How can I enable back this feature?

enter image description here

Mhd
  • 2,778
  • 5
  • 22
  • 59
  • How did you manually include it? With a using statement? If so, show us your using statement. – NMGod Jun 21 '17 at 00:13
  • Adding a "using" directive is not the same as adding a reference. You still need the corresponding assembly (dll) added as a reference. Are you sure you have the System.Xml assembly added as a reference to your project (look in the "References" node in the project node in the Solution Explorer window) – Simon Mourier Jun 22 '17 at 07:04
  • @SimonMourier System.Xml assembly was added – Mhd Jun 22 '17 at 12:41
  • And everything else works? I mean is IntelliSence enabled? – Erik Šťastný Jun 22 '17 at 12:56
  • @ErikŠťastný IntelliSence is working fine – Mhd Jun 22 '17 at 12:57
  • You will have to spin the Repair/Reinstall wheel of fortune. – Hans Passant Jun 22 '17 at 13:49
  • @HansPassant Ok. I thought I'm missing something with the configuration – Mhd Jun 22 '17 at 14:00
  • check your notifications in Visual Studio, I had this a couple of times and Visual Studio gave me the option to repair this part. – Cerveser Jun 26 '17 at 19:16

4 Answers4

1

You should clear your Visual Studio temp files - it can often get confused about project structures and require a fresh start.

First, quit out of VS completely and restart it. If the problem is still there, find your VS cache folder and delete it, and then do a rebuild.

check this link For help finding your cache folder,

Jay Patel
  • 2,341
  • 2
  • 22
  • 43
0

You can try to clear the MEF Component Cache. The component cache is located at %localappdata%\Microsoft\VisualStudio\14.0\ComponentModelCache.
Use this extension or delete the cache manually.

0

Press CTRL + . which means (dot) over the word XmlDocument to get it.

Amit Kumar Singh
  • 4,393
  • 2
  • 9
  • 22
0

I would try in VS 2015 [Tools] --> [Options] --> [Text Editor] --> [C#] --> [Advanced] --> [x] Suggest usings for types in referenced assemblies (check this)