How to show all StyleCop warnings for a solution?

If I have 2 projects in my solution, and each of them is configured to run StyleCop, MSBuild will only show warnings for one project.

Is there no way to show warnings for each project?

+3
source share
1 answer

You can use msbuidl and the msbuild extension package, in particular: MSBuild.ExtensionPack.StyleCop.dll

for path analysis (everything here is here), for example

     

and send files to the task

<MSBuild.ExtensionPack.CodeQuality.StyleCop
     TaskAction="Scan"
      ShowOutput="true"
      ForceFullAnalysis="true"
      CacheResults="false"
      SourceFiles="@(SourceFiles)"
      SettingsFile="$(SourceAnalysisSettingsFile)"
      ContinueOnError="false">
             <Output TaskParameter="Succeeded" PropertyName="AllPassed"/>
             <Output TaskParameter="ViolationCount" PropertyName="Violations"/>
             <Output TaskParameter="FailedFiles" ItemName="Failures"/>

</MSBuild.ExtensionPack.CodeQuality.StyleCop>

Hope you get started.

+2
source

All Articles