Reputation: 2518
Running MSBuild with /p:RunCodeAnalysis=true
on 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
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