

There are certain tools that have become indispensable for developers in this day and age. These tools often start as “nice-to-haves” but quickly graduate to “must-haves” due to the benefits they provide. Once you get used to relying?on them, it’s terribly frustrating when you’re prevented from using them for some reason. And there’s a very specific tool in that category I want to talk about today. It’s called Visual Studio IntelliSense.
This intelligent code completion tool present in Visual Studio is definitely a must-have for a .NET developer. The .NET Framework BCL (Base Class Library) is just too large for a human?brain to grasp. There’s no way you could remember all those classes, interfaces, and methods. Being able to put a period after some variable and get a nice list of all the possible members you can call isn’t only a nicety: it’s a survival need. So, what to do when you need Visual Studio IntelliSense but, for whatever reason, it’s not working? That’s what this post is about.
We’ll start out by doing a quick overview of Visual Studio IntelliSense. We’ll cover a little bit of history, plus a few definitions, so you can grasp why this tool is more than a simple autocomplete. Then we’ll proceed to cover the different solutions you can try to get you out of this nightmarish scenario.
We’ll then close the post with quick advice on how to get IntelliSense to work for your own classes and types.
Visual Studio IntelliSense Stopped Working. What To Do?
Visual Studio IntelliSense is an instance of automatic code completion. Microsoft first introduced it in 1996, but they based the tool on a lot of existing concepts of automatic code completion and syntax checking.
In the most recent versions of the Visual Studio IDE, IntelliSense kicks in when the user starts typing, instead of requiring some special procedure or particular characters. Based on what the developer is typing, Visual Studio can infer a lot.
Now, for the possible solutions. I’ll rank them from more general to more specific. So, the first couple entries will be very general Visual Studio troubleshooting advice. As you progress through the list, things will get more and more specific. But before we get into the list, I think we need?a disclaimer of sorts?keep in mind that there are several scenarios that can cause IntelliSense to stop working. The workarounds we’re going to present here have worked for myself and others several times, but your mileage may vary.
With that out of the way, let’s get started.
Workaround #1: Restart Visual Studio
Yeah, I know. This sounds like something your run-of-the-mill tech support person would say to get some client off their back.?But it’s surprising (or maybe not) the number of times restarting Visual Studio manages to make it stop acting up. And that’s not only in regard to IntelliSense not working.
I don’t guarantee this will actually solve your issue, but why not give it a try?
Workaround #2: Restart Your Machine
Restarting your Visual Studio didn’t get Intellisense back? Well, then try restarting your machine. I’m aware this is one of the silliest approaches you could take to solving your IDE problems. But then again, it’s amazing how often doing this actually helps. So, go grab a cup of coffee (or another beverage of your preference) while your machine restarts and hope things will be fine when you’re back.
Workaround #3: Update Your Visual Studio
Restarting didn’t work, and that’s a bummer. I do hope your coffee/tea/whatever was delicious though, if it’s some consolation. Time to get a bit more serious.
If restarting had no effect, the next step on the list would be to make sure your Visual Studio installation has all its updates. As you know, keeping your applications updated isn’t just good for security. It also helps you make sure you get fixes for those mostly harmless but still annoying bugs. If your Visual Studio IntelliSense is malfunctioning due to one of those, this might be just what you need.
Workaround #4: Verify Some Specific Visual Studio Configurations
If all of the above didn’t work, it’s time to verify some configurations in Visual Studio itself. Go to Tools -> Options -> Text Editor -> All Languages -> General. Make sure “Auto List Members” is checked. Also, make sure “Parameter Information” is checked.
There are a few other configurations you should check out, too. Still under Text Editor, go to “Basic” and then “IntelliSense.” Make sure you have the following three checked:
- Show completion list after a character is typed
- Highlight matching portions of completion list items
- Show completion item filters
Now, what if you’ve got all of the options above checked and it still doesn’t work? It will sound silly (again), but here goes: try unchecking all of them and then checking them again. Then click on “OK” and see if everything works fine.
Still nothing? Well, you’re out of luck then because the next step is pretty extreme.
Workaround #5: Reinstall Visual Studio
Having to reinstall Visual Studio is definitely a huge bummer. If things get to this point, you’re in for loads of wasted time. Still worth it? In my opinion, definitely. Just think about the loss of productivity you’d incur by not using IntelliSense in the first place. Simple math.
Getting Visual Studio IntelliSense To Work For Your Own Classes
We hope you’ve been able to get Visual Studio IntelliSense up and running again. To finish the post, we’ll give you a quick tip on how to make Visual Studio IntelliSense work for your own classes. Have you ever wondered how to get an effect like in the following image?
As it turns out, it’s very easy. You get that help from IntelliSense for free when you add XML documentation the public members of your types. To be honest, this is a best practice?in and of itself, so you should be doing it anyway.
So, how would you go about that?
It’s very easy. In Visual Studio, position the cursor in the line above the declaration of any member (method, property, etc.). Then, press the forward bar three times. Visual Studio will automatically generate a stub for the member’s documentation. Basically, all you have to do is fill in the blanks.
Suppose you have a method like the one in the following code:
public void PrintInfoAboutCommitAuthor(Commit commit) { string author = commit?.Author ?? string.Empty; Console.WriteLine("The author of the commit {0} is {1}.", commit.Id, author); }
If you do the process described earlier, Visual Studio will generate the following for you:
/// <summary> /// /// </summary> /// <param name="commit"></param>
Inside the summary tag, you fill in a general description for the method. Inside the param tag goes?you guessed it!?info about the “commit” parameter. That’s pretty much all there is to it. Do this process for all of the public members on your types and you’ll get nice IntelliSense features for them, for no additional costs.
More specifically, GhostDoc’s latest version has a feature that can help you get going with IntelliSense in no time. In this version, GhostDoc features a new documentation output format: the IntelliSense file, similar to what Visual Studio produces. By using this format, GhostDoc users can capitalize on the built-in filtering capabilities of the build help documentation dialog. Generation via command line interface is also possible.
That’s All For Today
Today’s post was sort of an unusual one for the SubMain blog. Instead of focusing on, let’s say, some construct of the C# language, or giving advice on how to keep your knowledge up to date, or even helping clarify mistakes made on a common programming domain, we’ve covered problems you might encounter with your IDE. It makes sense, though: Visual Studio is a .NET programmer tool as much as the C# language or the .NET framework itself.
See you next time!
Learn how GhostDoc can help to simplify your XML Comments, produce and maintain quality help documentation, generate IntelliSense documentation.
12 Comments. Leave new
Don’t forget about Ctrl-Shift-R to force Visual Studio to refresh IntelliSense.
Hey Neal. Thanks for the suggestion!
WTF is the “forward bar”?
From the illustrative code following that, I guess it’s the forward slash “/”; c.f. vertical bar “|”.
This is thorough and well done. The only improvement I would suggest is to cut out the small talk and only write lines that go straight to the subject as in newspaper writing with a precise topical approach(short stacked lists) . Your post would narrow down to probably near a 1/4 its size, and the reader’s time minimized.
Should you not add the Ctrl-Shift-R(as suggested by Robinson) at the top of this work?
For C++ projects the usual solution is to delete (or rename) the .vs folder in the same folder as the solution. You lose your setup of currently open documents but nothing important.
https://stackoverflow.com/questions/18289936/refreshing-the-auto-complete-intellisense-database-in-visual-studio
Since update it does not work anymore. Or better: it does only work partially !!! Some folders in my “solution” cannot be opened because they are empty – but they are not! Some namespaces are found others not. I am working with Unity pojects only. Unity plugin is installed.
found the problem: remove the hidden .vs folder!
Well what do you know. If unchecking and then rechecking the check boxes under the “Options…Text Editor” (Work Around #4) didn’t work. Unbelievable, how do these things get screwed up out of the blue in the first place?
Good article, but I wish people would skip lengthy introductions, I knew what intellisense was and why one such as myself would need it, before I googled that it wasn’t working 🙂 I know we see this all over the place, but I think this is where learning by example has really hurt things. Just like stock images, takes up space and doesn’t add any value. Think about how much duplicate content is out there just in the introduction paragraph of every blog? Imagine if I started this comment with “Comments are an interesting way to gather user feedback. You’ll see my comment near the end, but first let’s go over a brief history of comments”?!
Kind Regards.
When you see that “restart your machine” is the first suggestion you understand article author doesn’t have a clue about what he’s talking about.