Visual Studio 2015: Intellisense errors, but solutions compiled

We are currently evaluating a new version of Visual Studio 2015 and are facing an unusual intellisense issue. When I compiled our main solution with the new studio, the assembly is successful, but 6 errors are displayed nonetheless.

I found that this is not a real error, but only an intellisense error. The code is definitely correct and everything compiled successfully. However, the code is marked in red, and errors are displayed in the error list.

All 6 errors are of the same origin. This is a simple constructor call. Strange enough, but there are some occurrences of the same constructor without errors.

Error message:

Code: CS1729 Message: '<the class>' does not contain a constructor that takes that many arguments. Project: <the project name> File: <the path to the file> 

The new studio was installed on the recently installed Windows 7 without any outdated software (without VS13).

I already tried to clear the caches, deleted the suo file, deleted the bin and obj directory, cleaned and rebuilt the solution, etc. But nothing happened.

Can someone explain this behavior to me?

+67
visual-studio visual-studio-2015 intellisense
Aug 11 '15 at 13:49
source share
6 answers

There was also a problem with the migrated project, so I referenced the Microsoft.CSharp dll. In some projects, I needed to delete and add the link in the project again.

+23
Sep 15 '15 at 12:40
source share

I had thousands of intellisense errors and 0 build errors. After deleting the .suo file, VS intellisense errors restart.

The Suo file is located relative to the source in: .vs \ SolutionName \ v14.suo

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

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

+107
Nov 02 '15 at 12:30
source share

This issue also occurred (heading, not a specific error message), as well as curved lines in the editor. The first squiggly line is under the first #include statement, which names the precompiled header. Intellisense cannot include a precompiled header, but does not indicate this as an error; instead, it lists errors further down the file, by code that (very rightfully) relies on declarations in a precompiled header.

The reason Intellisense cannot find the precompiled header in my environment is because the header with the name is not the actual file. It should not be in any other version of VC or gcc that I used, nor in the 2015 compiler, as long as the precompiled header settings are configured. Apparently not for Intellisense anymore. I'm not quite sure that in 2013 it was different, maybe I just did not notice.

In the unlikely event that this will be the problem described here, the solution is simple: create a small file with the pretended name of the precompiled header, as specified in the #include directives, and let this file contain the actual name of the precompiled header.

If you're wondering ... why is this the difference between the precompiled header in the "#include" expression and the actual file name of the precompiled header? Precisely because it guarantees the correct setting of precompiled headers. Where the precompiled header is "#included", there is no file that can be included. It either looks at the actually precompiled (binary) version of the actual header, or the compilation fails. Obviously, the disadvantage is that it confuses people reading the code, not just Intellisense.

+6
Sep 15 '15 at 20:55
source share

Enable a similar issue in the Visual Studio 2017 Basic Project Project. The following steps did the trick for me

  • Executing a clean solution
  • Close VS
  • Delete .suo file and delete bin / obj files
  • Reopen VS
+6
Apr 01 '17 at 21:24
source share

Today I have a similar problem with MSVC ++ 2015. I almost gave up and decided to continue without IDE prompts, but sometimes I noticed that the stdafx.h subproject I had problems with does not contain any standard library headers. I suggested that this might slow down the compilation of the module, but the inclusion of standard headers there also fixed Intellisense.

0
Jan 22 '17 at 19:40
source share

I had several stdfax.h in the additional Include directories. Make sure that stdafx.h , which you intend, is the first in your path.

0
May 30 '17 at 14:56
source share



All Articles