如何从MSBuild代码分析中获取XML报告 [英] How to get an XML report out of MSBuild Code Analysis
问题描述
在C#项目上使用/p:RunCodeAnalysis=true
运行MSBuild的确会在生成输出中生成代码分析警告,但是通过什么开关,我可以将这些警告(仅代码分析警告而不是整个生成输出)导出到XML文件. ?
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?
推荐答案
默认情况下会生成XML报告.文件名是MyAssembly.dll.CodeAnalysisLog.xml
或MyApplication.exe.CodeAnalysisLog.xml
,您应该能够在项目的输出文件夹中找到它.
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.
要更改XML报告的名称,请使用参数CodeAnalysisLogFile
:
To change name of the XML report, use parameter CodeAnalysisLogFile
:
msbuild MyProject.csproj /p:RunCodeAnalysis=true /p:CodeAnalysisLogFile=MyXmlReport.xml
这篇关于如何从MSBuild代码分析中获取XML报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!