Ahsan
Ahsan

Reputation: 2518

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?

Upvotes: 7

Views: 6470

Answers (1)

seva titov
seva titov

Reputation: 11920

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

Upvotes: 13

Related Questions