last day (14 days later) » 

12:35 PM
0
Q: Showing code Warnings in Visual Studio

sedulamI'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 on...

 
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 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.
 
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 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?
@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"
 
You DO use a solution, right? you are not just opening files.
 
12:35 PM
Hi TomTom. I moved the discussion here as suggested by SO.
Of course :) It's a solution with two projects in it.
 
1:06 PM
Did you try running "Run Code Analysis" instead of "Run Code Analysis and Suppress active issues", to see if it fixes this issue? This is just a wild guess, but I wasn't sure if it was because it was suppressing the issues because of that option you picked.
 
I did, but it still shows the same behaviour. I was now able to solve the 2nd part of my question though (about the surpressed warnings from the code analysis). Apparently it creates a GlobalSuppressions.cs on the root of the project. Deleting that file, amde the warnings from the code analysis visible again.
However, the warnings that we were talking about (there are not generated by the code analysis) are still not visible if the file is not opened.
This behaviour is very strange to me. I don't see the advantages of hiding warnings when the file is not opened.
 
I agree, unless maybe you had a very large project and maybe wanted to only show open errors so that it was easier to manage?
 
Probably... Maybe it filters out the warnings that it finds less relevant.
Anyway, thanks for your help. Let's see if someone is able to come along with a specific reason :) cheers
 
Good luck!
 

last day (14 days later) »