Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get an XML report out of MSBuild Code Analysis

Running MSBuild with /p:RunCodeAnalysis=trueon a C# project does generate the code analysis warnings on the build output, but what's the switch that lets me export these warnings (only the code analysis warnings not the entire build output) to an XML file?

like image 612
Ahsan Avatar asked May 27 '15 03:05

Ahsan


1 Answers

The XML report is generated by default. The file name is MyAssembly.dll.CodeAnalysisLog.xml or MyApplication.exe.CodeAnalysisLog.xml, you should be able to find it in the output folder for you project.

To change name of the XML report, use parameter CodeAnalysisLogFile:

msbuild MyProject.csproj /p:RunCodeAnalysis=true /p:CodeAnalysisLogFile=MyXmlReport.xml
like image 71
seva titov Avatar answered Sep 30 '22 14:09

seva titov