c - How to run Visual Studio's Code Analysis on the command line exactly like in the IDE? - Stack Overflow

I have a VS solution with multiple projects.The code is written in C.I am using Visual Studio 17.12

I have a VS solution with multiple projects. The code is written in C. I am using Visual Studio 17.12.4 Enterprise. When I run the Code Analysis within VS, the analysis is successful on all projects. Note, I am running the clang tidy and Microsoft code analysis.

I try to repeat this process on the command line with the following:

msbuild mySolution.sln /t:Rebuild/p:Configuration=Debug /p:Platform=x86 /p:RunCodeAnalysis=true /p:CodeAnalysisRuleSet="C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Team Tools\Static Analysis Tools\Rule Sets\NativeRecommendedRules.ruleset" /flp:logfile=%FILELOG%

The analysis works on most of my projects, but it fails on a couple. The reason for failure appears to be due to missing prebuild steps in those project files. However, if I set RunCodeAnalysis=false, then those prebuild steps are successful. The prebuild steps are also successful when running code analysis on Visual Studio.

So what am I missing? Is the Visual Studio Code Analysis doing something different?

I have tried multiple combinations of Target (ClangTidy, Build, Rebuild, Rebuild;ClangTidy, etc).

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744786030a4593632.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信