Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable Code Analysis for Some Projects using MSBuild
    text
    copied!<p>I have inherited a solution file that uses a MSBuild script to compile multiple solutions. The majority of projects are configured with analysis and rulesets and I have a few unit-test projects that don't.</p> <p>Projects with analysis turned on:</p> <pre><code>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "&gt; &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt; &lt;DebugType&gt;full&lt;/DebugType&gt; &lt;DefineConstants&gt;CODE_ANALYSIS;DEBUG;TRACE&lt;/DefineConstants&gt; &lt;Optimize&gt;false&lt;/Optimize&gt; &lt;OutputPath&gt;bin\Debug&lt;/OutputPath&gt; &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt; &lt;CodeAnalysisRuleSet&gt;..\OurRules.ruleset&lt;/CodeAnalysisRuleSet&gt; &lt;RunCodeAnalysis&gt;true&lt;/RunCodeAnalysis&gt; &lt;/PropertyGroup&gt; </code></pre> <p>Projects with analysis turned off:</p> <pre><code>&lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "&gt; &lt;DebugSymbols&gt;true&lt;/DebugSymbols&gt; &lt;DebugType&gt;full&lt;/DebugType&gt; &lt;DefineConstants&gt;DEBUG;TRACE&lt;/DefineConstants&gt; &lt;Optimize&gt;false&lt;/Optimize&gt; &lt;OutputPath&gt;bin\Debug&lt;/OutputPath&gt; &lt;PlatformTarget&gt;x86&lt;/PlatformTarget&gt; &lt;RunCodeAnalysis&gt;false&lt;/RunCodeAnalysis&gt; &lt;/PropertyGroup&gt; </code></pre> <p>When I run my build script, it looks like some projects are not respecting the project settings:</p> <pre><code>msbuild.exe BuildScript.proj /p:SolutionRoot=%cd%; /p:Configuration=Debug /p:Platform:x86 /p:RunCodeAnalysis=True </code></pre> <p>When I check the output folder, I see coverage analysis xml outputs for projects that have the RunCodeAnalysis flag set to false. Can someone help me understand what's going on here?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload