How to get an XML report out of MSBuild Code Analysis

依然范特西╮ 提交于 2020-01-12 08:02:13

问题


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?


回答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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!