Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable code analysis in MSBuild target ClCompile?

When I build my projects via MSBuilds scripts, I obtain the following message during the work of ClCompile target: Running Code Analysis for C/C++…

Output of MSBuild looks like:

ClCompile:
  ....
  Source1.cpp
  Source2.cpp
  Running Code Analysis for C/C++…

After changing <RunCodeAnalysis> property in build scripts to false:

<PropertyGroup>
    <RunCodeAnalysis>false</RunCodeAnalysis>
</PropertyGroup>

this just disabled running RunCodeAnalysis MSBuild target, but it does not affect running code analysis in ClCompile target - it seems it should be disabled somewhere else.

How can I disable code analysis during execution of ClCompile target?

like image 478
sergtk Avatar asked Jan 30 '26 14:01

sergtk


2 Answers

<EnablePREfast> should be set up to false.

I have used the following code:

<PropertyGroup>
    <EnablePREfast>false</EnablePREfast>
</PropertyGroup>

More info at CL Task

like image 101
sergtk Avatar answered Feb 02 '26 05:02

sergtk


In Project Property page, goto Code Analysis (the last one on left tree). There you can disable Code analysis feature. In VC10+, you just need to de-select second check box. In earlier versions, you set third property to No.

like image 40
Ajay Avatar answered Feb 02 '26 04:02

Ajay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!