10

I want to run the code code analysis tool provided by VS 2015 from the command line the same way I was able to generate FxCop reports, something like this:

FxCopCmd.exe /console /project *Project* /out:*ReportFile*

Note that I don't want to use the FxCop tool, instead I want to launch the code analysis tool to generate a report, similar to what is generated when I select:

Analyze -> Run Code Analysis on Solution

Any idea how that can be accomplished?

UPDATE: After some research, I found out that Running code analysis actually executes the FxCopCmd.exe located in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe

Pinte Dani
  • 1,989
  • 3
  • 28
  • 35

1 Answers1

14

Finally I found myself a solution for this.

All I had to do is to add a new Parameter to the MSBuild command:

msbuild MySolution.sln /p:RunCodeAnalysis=true

In fact, this does generate a xml report which looks 1:1 to the generated fxCop report.

Pinte Dani
  • 1,989
  • 3
  • 28
  • 35