Shreeram
Shreeram

Reputation: 99

Supress all violations in Code Analysis Visual studio 2015

We have a huge project consisting of 35 solutions currently. We want to baseline all existing violations and then to enforce check for new violations only.

In Visual Studio Code Analysis, if i try to suppress all warnings for a project by selecting "suppress in Supression File", only few of them goes into GlobalSupression.cs and not all the warnings.

Is there a way i can make all of the warnings to go into GlobalSupression.cs rather than making inline supressions?

Upvotes: 1

Views: 491

Answers (2)

Shreeram
Shreeram

Reputation: 99

The reason why "Suppress in Supression-File" doesn't suppress all warning is because, the list of warnings also contains compiler warnings.

In the Error-List window, Enable Tool column to see which tool raised the warning. If it is compiler warning, then you must fix them or ignore them. They can never be added into suppression list.

Upvotes: 0

Peter
Peter

Reputation: 27944

If you want to see new warnings you can suppress global because any new violations are directly suppressed by your global suppression. You need to specify the smallest scope possible. When you put them in a global file you do not see why if and why the violation is allowed.

However a other solution could be to introduce you Code Analysis slowly into your project and fix the actual technical depth by adding a rule every x time and fix depth. This will let your team slowly adept to the new rules.

Upvotes: 1

Related Questions