Skip to content

Instantly share code, notes, and snippets.

@esride-apf
Created August 13, 2011 08:11
Show Gist options
  • Select an option

  • Save esride-apf/1143600 to your computer and use it in GitHub Desktop.

Select an option

Save esride-apf/1143600 to your computer and use it in GitHub Desktop.
Sample MSBuild target to run static codeanalysis tool FxCop
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);FxCop</BuildDependsOn>
<RebuildDependsOn>$(RebuildDependsOn);FxCop</RebuildDependsOn>
</PropertyGroup>
<Target Name="FxCop">
<Exec
Command="&quot;$(TargetDir)..\tools\FxCop\FxCopCmd.exe&quot; /file:&quot;$(TargetPath)&quot; /project:&quot;$(TargetDir)..\src\BuildOnly.FxCop&quot; /directory:&quot;$(TargetDir)..\lib\Microsoft&quot; /dictionary:&quot;$(TargetDir)..\src\FxCop.CustomDictionary.xml&quot; /out:&quot;$(TargetDir)$(ProjectName).FxCopReport.xml&quot; /console /forceoutput /ignoregeneratedcode">
</Exec>
<Message Text="FxCop finished." />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment