如何从MSBuild代码分析中获取XML报告 [英] How to get an XML report out of MSBuild Code Analysis

查看:66
本文介绍了如何从MSBuild代码分析中获取XML报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#项目上使用/p:RunCodeAnalysis=true运行MSBuild的确会在生成输出中生成代码分析警告,但是通过什么开关,我可以将这些警告(仅代码分析警告而不是整个生成输出)导出到XML文件. ?

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?

推荐答案

默认情况下会生成XML报告.文件名是MyAssembly.dll.CodeAnalysisLog.xmlMyApplication.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆