Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015 Error List items all doubled

In VS2015, I'm working on native C++ if that matters, all the warnings in the Error List are doubled. I know headers will be included multiple times, but I can see that an item for a .cpp file is listed twice with the same line number and identical contents.

I've disabled any extensions I can, and the filter option is set for "Build Only" (not also showing Intellisence errors). (The only thing I found on web searches was for different kinds of projects where different tools were both finding the error)

I don't know where else to look for what's causing it.

enter image description here

I've redacted the project names and file names, but each item in the pair is identical in these fields as well. The bottom pair is from a Qt *.ui code generator, not the CL task. This tells me that it's not an individual Task causing this, but something about the Error List as a whole.

They are not doubled in the Output window. This occurs even just after loading the project and building, so there is nothing leftover in the Error List memory from a previous compile.

like image 649
JDługosz Avatar asked Jan 13 '16 23:01

JDługosz


People also ask

How to show Error List Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.

How to check Error in Visual Studio code?

You can click on the summary or press Ctrl+Shift+M to display the PROBLEMS panel with a list of all current errors. If you open a file that has errors or warnings, they will be rendered inline with the text and in the overview ruler.


3 Answers

In my experience, this issue is caused by setting MSBuild verbosity to Normal instead of Minimal. So the simplest, least destructive, fix is: Tools...Options...Projects and Solutions...Build and Run...MSBuild project build output verbosity: Minimal.

like image 82
Scott Hutchinson Avatar answered Oct 19 '22 00:10

Scott Hutchinson


First try if you can reproduce this behavior with an minimal C++ example (plain commandline application without Qt). Create a new project from "File" -> "New" -> "Project" -> "Visual C++" -> "Empty Project" and add only one C++ file as new item. i.e.

int main() {
  long a = 1;
  float b = a;
}

If your problem still persists try to reset your Visual-Studio Settings: To do this select from the Menubar "Tools" -> "Import and Export Settings Wizard" -> "Reset all settings" -> "No, just reset settings, overwriting my current settings". After doing this & performing a full rebuild, it should not list any error/warning twice anymore (except for the case, that you have the same error/warning really occurring twice in the affected lines - but I doubt, this is the case for you). It's possible that either from an update or by accidently changing some settings, Visual studio was performing two stages of compilation - in this case all errors & warnings are listed two times too: i.e. when building a WPF application that uses a XAML file this is the case.

like image 2
Constantin Avatar answered Oct 19 '22 00:10

Constantin


One possibility is that you are looking at the Error List Window with the window configured to show both Build and Intellisense errors.

If that's the case, look for a drop-down box to the right of the Errors, Warnings and Messages buttons. The box will say "Build+Intellisense". Change it to "Build Only" or "Intellisense Only" as desired.

enter image description here

like image 2
Frank Boyne Avatar answered Oct 18 '22 22:10

Frank Boyne