133
votes

My colleagues and I are using VS2012 for some weeks now. Sometimes after working several hours the intellisense is broken. After closing all open tabs it works again.

Are there more people out there having the same problem? It can't be an extension problem because I have the same problem at home. Maybe there is a workaround for this?

21
Does using Ctrl + Space works after this problem appears?SajjadHashmi
No Ctrl+Space does have no effectKroaX
Visual Studio uses independent implementations of IntelliSense for each of its supported languages, so the answer will likely depend on the particular language in use. In addition, several Visual Studio extensions alter, augment, or even completely replace the IntelliSense features for one or more languages, which is likely to change the answer provided here.Sam Harwell
Please vote in this uservoice to ask for a soft-reset chord to at least mitigate this: visualstudio.uservoice.com/forums/121579-visual-studio/…mattmanser
I have this issue. I did not install any plugins to VS or ever. Just opened and closed solutions and files in normal mode I do each time. So no clue what leads to such error.Dzmitry Lahoda

21 Answers

184
votes

These are the few top solutions for getting Visual Studio 2012 intellisense back on track try them one by one, hope one of them will solve the problem:

When the problem occurs next time follow these: start from #1 and Move to next when the earlier one doesn't work for you

1: Close all the tabs and open your file again. (Thanks to russds)

2: Clean the Build > Close the Solution > Restart Visual Studio > Open the Solution again

3: Goto: Edit > IntelliSense > Refresh Local Cache

4: Close Visual Studio 2012 and delete this folder: %AppData%\Microsoft\VisualStudio\11.0\ReflectedSchemas

5: Goto: TOOLS > Import and Export Settings > Reset all settings

6: Delete .suo file in the project folder. (Thanks to Jason Steele)

I am hopeful your problem will get solved by any of the above six steps. But if it doesn’t after all this than I think you should consider reinstalling your VS2012.

19
votes

I use Visual Studio 2012 and I have the same problem. To fix it (when Intellisense is not working anymore), I just have to close the current tab (in which Intellisense is not working) and reopen it. There is no need to close Visual Studio or all the tabs.

13
votes

Tried everything. The thing that WORKED is deleting the SUO file. It is a hidden file called SolutionName.v11.suo in the solution directory:

  1. Close the solution
  2. Make sure you can see hidden files.
  3. Erase the suo file.
  4. Reopen solution.

You will loose the solution desktop (no files will be opened automatically in the editor), but that's a small price to pay to get intellisense back :)

13
votes

You don't need to restart Visual Studio. Instead, close the current solution and then reopen it again. I hope there was an easier solution though.

Update 4/16: For XAML users, a solution that works is as simple as intentionally breaking your code; this should be enough to retrieve intellisense back. More in here.

Could not verify if this works for other types of code as well, but if it does, please leave a comment.

12
votes

Delete the .suo file. Try this, it worked for me after all else failed.

6
votes

I have the same problem. For me, selecting the end of the very last line of the file, and then saving the file (ctrl-s) fixes the problem.

2
votes

I should first note that this hasn't happened to me since upgrading my RAM to 16GB.

This seems to happen when I copy/paste controls on a page. Another side affect of this is that the designer.vb file is not updated right away and I don't have access to those controls in code behind.

This is the order of steps that I go through:

  • If only 1 file/window appears to be affected, close/reopen that file.

In Visual Studio:

  1. Click Tools->Options->Text Editor->All Languages->General
  2. Uncheck "Auto list members"
  3. Uncheck "Parameter information"
  4. Check "Auto list members" (yes, the one you just unchecked)
  5. Check "Parameter information" (again, the one you just unchecked)
  6. Click OK

If this doesn't work, here's a few more steps to try:

  1. If still not working, close all windows and reopen
  2. If still not working, close/reopen solution
  3. If still not working, restart VS.

For C++ projects:
MSDN has a few things to try: MSDN suggestions

The corrupt .ncb file seems most likely.

From MSDN:

  1. Close the solution.
  2. Delete the .ncb file.
  3. Reopen the solution. (This creates a new .ncb file.)

(I haven't yet figured out why more drastic steps are required in some cases.)

  • Tested in VS 2013/15
  • I haven't had this issues since upgrading my RAM
1
votes

I had some bad xaml code. It wasn't giving an error when compiling, but it was still preventing the intelliSense from working properly within the xaml file.

I removed the following code to fix the issue: Binding="{Binding ReturnCode & Info}"

the '&' being the problem

1
votes

None of these worked for me, but I finally got it working by disabling Resharper. I'm not sure why it was necessary because I have another LS solution where intellisense is working fine. Just thought I'd post it in case someone else has the same problem I had.

1
votes

I encounter the same problem and solve it. Keep that in mind, if you are working with Silverlight any incorrect XAML code can crash IntelliSense. I suggest if you are working with Silverlight, compile your project for detecting incorrect XAML codes and solve them in first step and if the problem continues then use above steps.

1
votes

The problem is with the .vcproj files.

You will find if you switch to release mode from debug mode, build, then try intellisense it often works.

Close Visual Studio. If you search for the .vcproj files in your project, edit them and search for the first two instances of AdditionalIncludeDirectories. The value for this should look something like "..\,....\" rather than "../..".

Reopen your project, let the Intellisense finish building, then it should be fixed.

1
votes

Steps to follow:

  1. Go to Tools Menu
  2. Click on "Import and Export Settings"
  3. Select "Reset all settings". Click Next
  4. Back up your Settings. Click Next
  5. Select your environment settings(e.g. Visual C# Development Settings). Click Finish.

No need to restart the Visual Studio.

1
votes

I had an issue with razor Intellisense not working at all in one of my projects. None of the fixes above worked for me. I was finally able to resolve the issue by changing the webpages version in the web config to 2.0.0.0 instead of 3.0.0.0 shown below:

<appSettings>
   <add key="webpages:Version" value="2.0.0.0" />
   ...
</appSettings>

I hope this helps someone else.

0
votes

None of the above helped to fix Intellisense on my devbox (VS2012). I even tried "devenv /resetuserdata" which resulted in necessity to reinstall all plugins.

Still, in C++ projects the code in #if ABC ... #endif blocks stay greyed out.

As a temporary workaround I modify #if ABC into #if 1//ABC, and then revert change back after I finish editing the block. Annoying...

EDIT: Few hours later I found better solution. I commented out "#define ABC 1" in the header file, and added "ABC=1;" to the Project Properties->C/C++->Preprocessor->Preprocessor Definitions. Then Intellisense started working correctly! The code blocks are not greyed out.

0
votes

I was having a similar issue in Visual Studio 2013, I just cleaned the solution and then deleted 4: Close Visual Studio 2013 and delete this folder: %AppData%\Microsoft\VisualStudio\12.0 and it solved the problem.

0
votes

I've isolated my issues to be with VS Power Tools corrupting the *.suo. Closing VS, deleting the .suo, then re-opening fixes the issue. It also deletes all personal settings for that solution.

Another, less destructive solution I've run across is to use the "Edit Project File" power command and then reload the project to get intellisense to work again.

Hopefully that helps others.

0
votes

for VS2013 - ASP.NET MVC 5 Project, an easy way to fix this was to unload and reload the specific project.

0
votes

For a Python project, I ended up deleting the hidden .vs folder, .sln file, and .pyproj file. I then recreated the project from existing code and Intellisense is working again.

0
votes

Closing the tab that doesn't work did it for me.

p.s. I would save before hand, just in case of VS being weird ;)

Oh, and the shortcut is Ctrl+Alt+Space (to toggle between suggestion and standard completion modes)

0
votes

I faced this problems multiple times and I still face it too.

The solution which worked for me was to reduce the length of the path where the solution is placed. I placed the solution closer to C drive (c:/code/your_project.sln) and it just solved the intellisense problem This always solves the problem.

-1
votes

None of the above worked for me. When examining closer, I noticed that intellisense worked on some files but not on all files. And then discovered it was only one file. Finally opened the .proj file which contained:

  <ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
<Compile Include="Generator.cs" />
<Compile Include="PDFDocument2.cs" />
<None Include="PDFDocument.cs" />
<Compile Include="PdfDaemon.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

Of course intellisense doesn't work on the file that is not marked as to be compiled.