Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2015 or 2017 shows IntelliSense errors but solution compiles

People also ask

How do I get rid of IntelliSense error?

You can disable the intellisence Error Reporting in VS2010 from Tools -> Option -> Text Editor -> C/C++ -> Advanced -> IntelliSence -> Disable Error Reporting.

Why is my IntelliSense not working?

If you find IntelliSense has stopped working, the language service may not be running. Try restarting VS Code and this should solve the issue. If you are still missing IntelliSense features after installing a language extension, open an issue in the repository of the language extension.

How do I get IntelliSense in Visual Studio 2017?

You can enable or disable particular IntelliSense features in the Options dialog box, under Text Editor > C/C++ > Advanced.


I had thousands of intellisense errors and 0 build errors. After deleting .suo file and restarting VS intellisense errors are gone.

Suo file is located relatively to source in: .vs\SolutionName\v14\.suo

According to comment: Beware that *.suo is a hidden file.

Edit: According to comments, VS2017 has the same issue, so you can use similar solution: Delete .vs\SolutionName\v15\.suo


Also had this problem with a migrated project, so I referenced the Microsoft.CSharp dll. In some projects I needed to remove and add again the Reference in the project.


Ran into similar issue in Visual Studio 2017 ASP.Net Core Project. Following steps did the trick for me

  1. Perform Clean Solution
  2. Close VS
  3. Delete .suo file & Delete bin/obj directories
  4. Reopen VS

Similar problem as others, but different resolution. Posting in case I can help someone else.

Running Visual Studio 2017 15.5.2. I use Git and frequently switch branches. Several weeks ago, I started having editors show me errors (all related to types it could not find even though references were valid). Compile worked great. I confirmed the same issue in VS 2017 15.6 Preview (Jan 6, 2018). I would try to delete cache, SUO files, or bin/obj folders and no impact. At first it would appear to work. Reopen Visual Studio and everything would look good. Use "Rebuild Solution" and the IntelliSense errors would returns. I even tried uninstall/reinstall of Visual Studio.

I had the same issue on two machines, both with same version of Visual Studio.

By looking at the errors about missing types, they all appeared to come from two referenced projects. One of those references was a shared project used by just about every other project in the solution, but one of them was a small project without many references. It just so happens that the small project was also referenced by my larger shared project. In Visual Studio, I unloaded the small project and reloaded it. The errors went away! They errors did not come back on Rebuild Solution.

I then switched Git branches and the errors all came back. Fortunately I repeated the above steps of unloading/reloading the small project and the errors went away.

Every time I switch Git branches, the errors come back until I repeat that process. There are zero changes between the Git branches for the smaller project that I unload/reload. Unclear why that sequence is fixing my issue.


Also had this problem (the title, not the specific error message), as well as squiggly lines in the editor. The first squiggly line is under the first #include statement, which names a precompiled header. Intellisense fails to include the precompiled header, but doesn't list that as an error; instead it lists errors further down the file, on code that (very rightfully) relies on declarations in the precompiled header.

The reason Intellisense doesn't find the precompiled header in my environment is that the header named is not an actual file. It doesn't have to be in any other VC or gcc version I used, nor in the 2015 compiler, as long as the precompiled header settings are correctly configured. Apparently not any more for Intellisense. I'm not entirely sure it was different in 2013, maybe I just never noticed.

In the unlikely case that this would be the problem reported here, the solution is simple: create a small file with the pretend-name of the precompiled header, as specified in #include directives, and let that file include the actual name of the precompiled header.

If you wonder... why this distinction between the precompiled header name in the '#include' statement and the actual filename of the precompiled header? Precisely because it guarantees that precompiled header settings are correctly configured. Wherever a precompiled header is "#included", there is no file around that could be included. Either an actually precompiled (binary) version of the actual header is read, or the compilation fails. Obviously, a disadvantage is that it confuses people reading the code, not just Intellisense.


Visual Studio 2017 I have deleted ".suo" file from location .vs\SolutionName\v15.suo And then restarted Visual studio. This worked for me.


Today I've had similar problem with MSVC++ 2015. I almost gave up and decided to go on without IDE hints, but suddenly I've noticed that stdafx.h of the project i had problems with doesn't contain any standard library headers. I've speculated that inclusion of all standard headers used in the project in stdafx.h might boost up compilation speed, however doing so fixed Intellisense errors as well.