1

I'm trying to improve code quality on a program using Visual Studio Enterprise 2015. The Error List is empty, but if I open specific files, then it shows warnings. The only active filter I have is the "Current Project", so I don't understand why is it not showing those warnings by default, but only when I open the files themselves. How can I make VS show all the warnings even for closed files?

Another question, I did "Run Code Analysis and suppress active issues" and I've lost the ones from the previous run. How can I revert this suppressor?

EDIT: One of the warnings I see when opening the file says the following:

RECS0065: Expression is always false

And refers to this section of the code:

if (sourceProject.uid == null
  && row[fieldConfig.ImportFieldName].GetType() == typeof(Guid)
  && (fieldConfig.ODataFieldName == "ProjectId"))

The expression will always be evaluated to false because the sourceProject.uid is always null at this stage.

Now, back to the main question what happens is that if I close the file, then the warning disappears from the Error List. I want to see these warnings even if the files are not opened in the Editor.

This is the kind of warnings that I'm trying to clean, basically just bad coding. My question is not asking how to solve the errors, but how to always visualise them.

Pedro Gordo
  • 1,825
  • 3
  • 21
  • 45
  • 2
    Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example - analog we need a lot more info from you to make sense out of what you ask. Sometimes the file type is relevant. – TomTom May 18 '16 at 12:08
  • @TomTom thanks for the clarification. I edited the post to provide more info, but as I said, this is not a code related question, but a question of how to correctly use the Error List in VS. – Pedro Gordo May 18 '16 at 12:16
  • Not raelly - this runs more down to the behavior of certain code analysis. If you do a COMPILATION - does the error appear and stay? – TomTom May 18 '16 at 12:17
  • @TomTom No. I can only see the warning if have the file opened in the Editor. It's weird to me that VS handles Warnings differently (I'm used to Eclipse), but I can see that the Error List has a column "Category". Is this behaviour related to that column? – Pedro Gordo May 18 '16 at 12:22
  • @TomTom For instance, the warnings that DON'T disappear have a category "Redundancies in Code", and the warnings that DO disappear have category "Redundancies in Symbol Declarations" – Pedro Gordo May 18 '16 at 12:23
  • You DO use a solution, right? you are not just opening files. – TomTom May 18 '16 at 12:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/112291/discussion-between-sedulam-and-tomtom). – Pedro Gordo May 18 '16 at 12:35

3 Answers3

4

In my Visual Studio 2017 (v15.2), I only see all of the warnings across all files in my solution after doing a "Rebuild All" from the Build menu.

Most of the warnings disappear again after doing a regular Build (Ctrl+Shift+B).

I get this behavior regardless of whether the Full Solution Analysis option is enabled.

Jon Schneider
  • 25,758
  • 23
  • 142
  • 170
1

To show all CA warnings see this

To revert surpressions delete GlobalSurpressions.cs file.

Community
  • 1
  • 1
Peuczynski
  • 4,591
  • 1
  • 19
  • 33
0

Update in visual studio 2019 professional You can select the scope of the error list in the left top corner of the error list window

  • current document
  • current project
  • ...

Error list window

Dimitrivh
  • 1
  • 1
  • 1
    The person was using vs 2015 and not 2019; The user asked this question 4 years ago, so I do not think your answer is really relevant to anymore. – Gert Kommer Oct 26 '20 at 10:34
  • Gert, i found this page here when i was searching for a solution when i figured it out i added a post here, because here could help others having same problem.. – Dimitrivh Oct 26 '20 at 17:26