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?
+2
A:
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>
Gerrie Schenck
2009-02-10 11:55:11
if you replace FlavorToBuild by Configuration, it works!
Jader Dias
2009-02-10 16:00:05
A:
Add a condition in the .msbuild script. Only execute the FxCop task if Configuration is "Release" not f.ex when it is "Debug"
ThorHalvor
2009-02-10 11:55:32
+3
A:
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>
madgnome
2009-02-10 12:03:44