Jader Dias
Jader Dias

Reputation: 90593

How to show all StyleCop warnings for a solution?

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

Isn't there a way to make it show warnings for every project?

Upvotes: 3

Views: 1848

Answers (1)

James Woolfenden
James Woolfenden

Reputation: 6681

You can use msbuidl and the msbuild extension pack, specifically: MSBuild.ExtensionPack.StyleCop.dll

to analyse a path (alll the code here) e.g.

and send the 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 that gets you started.

Upvotes: 2

Related Questions