Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make code analyzers ignore AssemblyInfo.cs

We have added #pragma warning disable to the top of all our AssemblyInfo.cs files. The built-in code analysis in Visual Studio 2015 professional, though, continues to analyze that file. What can we add to prevent this?

like image 425
Shaun Luttin Avatar asked Oct 30 '22 19:10

Shaun Luttin


1 Answers

The #pragma applies to compiler warnings, since Code analysis (binary) is applied to the produced assemblies, and the pragma information was lost during the compile stage, binary code analysis cannot be aware of this suppression.

The #pragma will work for the true Roslyn roles which act ont the sources instead of the binaries. If you do not enable "Binary Code Analysis" your warnings should be suppressed just fine. Do make sure you have an alternative enable for the rules you're disabling.

like image 112
jessehouwing Avatar answered Nov 15 '22 05:11

jessehouwing