I just learned about how to include FxCop on a build. But it's slow and I want it to be done just only on release builds. Is there any way to configure that?
I just learned about how to include FxCop on a build. But it's slow and I want it to be done just only on release builds. Is there any way to configure that?
Check the configuration condition.
<Target Name="AfterBuild" Condition="'$(Configuration)' == 'Release' ">
<FxCop TargetAssemblies="@(OutputAssemblies)"
RuleLibraries="@(FxCopRuleAssemblies)"
DependencyDirectories="$(MSBuildCommunityTasksPath)"
FailOnError="False"
ApplyOutXsl="True"
OutputXslFileName="C:\Program Files\Microsoft FxCop 1.32\Xml\FxCopReport.xsl"
DirectOutputToConsole="true"/>
</Target>
Haven't tested this but I think it should be something along the lines of:
<Target Name="MyTarget" Condition="'$(FlavorToBuild)'=='Release'">
...do release specific stuff...
</Target>
Add a condition in the .msbuild script. Only execute the FxCop task if Configuration is "Release" not f.ex when it is "Debug"