Msbuild not producing XML file with code analysis

折月煮酒 提交于 2019-12-11 05:37:53

问题


I have been digging but cannot find the answer - I THOUGHT I had found it in this question but it is not working on my system. The only difference that I can see is that I am giving msbuild a solution file and not an individual project file - must I do it at the project level to get output? The command line I entered was:

msbuild Interlink.NET.sln /p:RunCodeAnalysis=true /p:CodeAnalysisLogFile=test.xml

Obviously, test.xml was not created or I would not be asking this question...

The solution is a C# project in VS2015, in case any of that effects things. In Visual Studio, I can select "Analyze | Run Code Analysis on Solution" and things work as expected. I want to incorporate the analysis into an automated build process and produce an XML file with the analysis.


回答1:


Well yes the command that you used is correct and will work for .sln files. Only a test.xml file will be created inside each of the constituent projects. And these copies will contain the static code analysis reports of that specific prject. It will not be created at the level of the .sln file.




回答2:


I ran msbuild with the following arguments and the xml file got produced in the output directory, but the filename I've given got ignored. It was named vc.nativecodeanalysis.all.xml instead.

msbuild Project.sln /p:Configuration=Release /p:Platform=x64 /p:RunCodeAnalysis=true /p:CodeAnalysisLogFile=test.xml /t:Clean;Rebuild

Project.sln is a C++ project in VS2017 though.



来源:https://stackoverflow.com/questions/41105813/msbuild-not-producing-xml-file-with-code-analysis

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