问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/30472569/how-to-get-an-xml-report-out-of-msbuild-code-analysis