Visual Studio 2012 - Intellisense sometimes disappearing / broken
Asked Answered
W

21

133

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?

Weinberger answered 14/11, 2012 at 9:18 Comment(5)
Does using Ctrl + Space works after this problem appears?Pandit
No Ctrl+Space does have no effectWeinberger
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.Downswing
Please vote in this uservoice to ask for a soft-reset chord to at least mitigate this: visualstudio.uservoice.com/forums/121579-visual-studio/…Andresandresen
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.Stoddart
P
184

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.

Pandit answered 14/11, 2012 at 10:11 Comment(15)
Couldn't to #1 as that menu item does not exist in my VS2012(?). Couldn't do #2 as that folder dit not exist. But after restarting VS2012 the problem disappeared.Albuminous
i can not find anywhere refresh local cache under there ?Jackelinejackelyn
Same happened to me, none of the above worked, but closing all tabs did. That should be option one in this solution.Margy
4 worked for the project in VS 2012, but the folder is not there in VS 2013 and I still have the issue there. I tried deleting the similar looking GeneratedSchemas instead but that didn't work either.Sweptback
@matt: #5 didn't help me. Intellisense still fails for me in this one solution. (But it's fine in a brand new solution.)Defecate
in my case it worked on closing only the problematic tab (and reopening it), while leaving the other ones openChuddar
@SajjadHashmi, what do you think of editing your answer to include a step for deleting the .suo file? There are several comments and up-voted answers in this thread that suggest, and so it seems like it would help others to have it in this main list. I proposed an edit to this question today to include that, but my edit was rejected (for reasons that leave me perplexed and a little discouraged). Anyway, please consider that minor addition to your answer.Lay
For some reason, deleting the .suo file did help after I lost intellisense on .config files. Strange. Edit: using VS 2012Cornerstone
I just close VS and restart it.Grano
VS2013: Options->All languages, uncheck the statement completion checkboxes, close the dialog. Open the dialog, check them back again.Diatom
VS2012. Right-click on the project, unload it. Right-click on it again and reload it. That did the trick for me.Irritative
I followed these steps after none of the above worked: blogs.msdn.com/b/willy-peter_schaub/archive/2010/09/15/… Had the same problem a day later, then used the /safemode switch, presto. I must have a bad extension. Also, #3 doesn't appear to be there in 2013 anymore.Prentiss
I made closing all tabs, and got back intellisense. Then VS faked me into believe that I changed and updated code. But any build or rebuild did not help me debugging with reporting that I do not have source for changed file. So I closed VS and deleted suo, opened VS. It did something strange with file I modified and saved, but I god debugging back and things work.Stoddart
Based on this answer to a similar question, and my own (confirming) experience, unloading and reloading the Visual Studio project in Visual Studio also resolved this.Represent
My intellisense came back when I found Ii had the project open twice in separate VS instances. Try to close your VS and re-open. Look for extra VS that are already open.Cobbler
T
19

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.

Totalitarian answered 28/10, 2013 at 13:42 Comment(1)
This actually worked for me. Beats re-loading the whole solution or restarting visual studio.Metalinguistic
A
13

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.

Afterwards answered 28/3, 2013 at 17:54 Comment(1)
You don't need to close the current solution. Instead, just WINDOW > Close All Documents.Outrank
R
13

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

Roomy answered 7/1, 2014 at 14:27 Comment(3)
Any ideas as to why this is occurring? I'm now deleting my sou files 3 or more times per day. I haven't isolated to any plug-ins, but I'm guessing it's Web Essentials or Power Tools.Thereafter
@Alon Gingold - isn't this just what I said back in November 13? Anyway, I have the Xamarin tools installed and wondered if anyone else with a problem with .suo file is also having this problem?Sweptback
I have xamarin installed and have nothing but this problem every day with visual studio 2013Ghislainegholston
S
12

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

Sweptback answered 30/11, 2013 at 17:16 Comment(1)
Reminds me of the old days when you had to make the .ncb file read-only so VS 2005 couldn't use it and hang up while churning for 30 minutes on C++ headers.Selftaught
B
6

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.

Balas answered 14/6, 2013 at 18:4 Comment(0)
E
2

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
Ellipticity answered 14/5, 2015 at 22:20 Comment(0)
A
1

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

Anjaanjali answered 3/12, 2013 at 23:56 Comment(0)
C
1

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.

Cinderellacindi answered 22/12, 2013 at 18:36 Comment(0)
S
1

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.

Simonson answered 22/1, 2014 at 12:29 Comment(0)
A
1

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.

Acrylyl answered 12/2, 2014 at 11:43 Comment(1)
This fixed it for me after reinstalling VS did not.Hightension
S
1

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.

Saccharin answered 11/3, 2014 at 11:51 Comment(0)
K
1

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.

Knowlton answered 24/4, 2015 at 15:48 Comment(0)
Y
0

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.

Yoicks answered 30/11, 2013 at 3:32 Comment(1)
Visual Studio's default settings will gray-out all code that the compiler will skip due to compiler directives such as #if. If the defined constants change when your active configuration changes (for instance the #define debug is often set in Debug mode while not present in Release mode) then the portion of code which is grayed out will change.Hydrosphere
W
0

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.

Watchcase answered 7/3, 2014 at 22:2 Comment(0)
T
0

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.

Thereafter answered 19/7, 2014 at 17:37 Comment(0)
O
0

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

Opiumism answered 29/9, 2015 at 8:48 Comment(0)
C
0

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.

Composition answered 7/10, 2016 at 17:56 Comment(0)
P
0

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)

Phyllous answered 21/2, 2017 at 8:30 Comment(0)
F
0

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.

Faris answered 26/2, 2018 at 7:45 Comment(0)
P
-1

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.

Proposal answered 10/10, 2014 at 7:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.