The FxCop Build Runner is intended for inspecting .NET assemblies and reporting possible design, localization, performance, and security improvements.
If you want TeamCity to display FxCop reports, you can either configure the corresponding build runner, or import XML reports by means of service messages if you prefer to run the FxCop tool directly from the script.
The FxCop build runner requires FxCop installed on the build agent.
On this page:
For the list of supported FxCop versions, see Supported Platforms and Environments.
FxCop detection mode
When a build agent is started, it detects automatically whether FxCop is installed. If FxCop is detected, TeamCity defines the
Select to use the FxCop installation on an agent.
The option is available when autodetect installation is selected. Select one of the options from the dropdown. If you have several versions of FxCop installed on your build agents, it is recommended to select here a specific version of FxCop you want to use to run inspections in your build to avoid inconsistency. As a result, an agent requirement will be created. If you leave the default value of the field ('Any Detected'), TeamCity will use any available agent with FxCop installed. In this case the version of FxCop used in one build may not be the same as the one used in the previous build, thus the number of new problems found will be different from the actual state.
Specify installation root
Select to use a custom installation of FxCop (not the autodetected one), or if you do not have FxCop installed on the build agent (e.g. you can place the FxCop tool in your source control, and check it out with the build sources)
The option is available when Specify installation root is selected. Enter the path to the FxCop installation root on the agent machine or the path to an FxCop executable relative to the Build Checkout Directory.
Enter the paths to the assemblies to be inspected (use ant-like wildcards to select files by a mask). FxCop will use default settings to inspect them. The paths should be relative to the Build Checkout Directory and separated by spaces. Enter exclude wildcards to refine the included assemblies list.
Note that there is a limitation to the maximum number of assemblies that can be specified here due to command-line string limitation.
FxCop project file
Enter the path relative to the Build Checkout Directory to an FxCop project.
Search referenced assemblies in GAC
Search the assemblies referenced by targets in Global Assembly Cache.
Search referenced assemblies in directories
Search the assemblies referenced by targets in the specified directories separated by spaces.
Ignore generated code
A new option introduced in FxCop 1.36. Speeds up inspection.
Report XSLT file
The path to the XSLT transformation file relative to the Build Checkout Directory or absolute on the agent machine. You can use the path to the detected FxCop on the target machine (i.e. "%system.FxCopRoot%/Xml/FxCopReport.xsl"). When the Report XSLT file option is set, the build runner will apply an XSLT transform to FxCop XML output and display the resulting HTML in a new "FxCop" tab on the build results page.
Additional FxCopCmd options
Additional options for calling FxCopCmd executable. All options entered in this field will be added to the beginning of the command line parameters.
Check the box to fail a build on the specified analysis errors. Click build failure condition to define the number of the errors.
If you prefer to call the FxCop tool directly from the script, not as a build runner, you can use the
importData service messages to import an xml file generated by the FxCopCmd tool into TeamCity. In this case the FxCop tool results will appear in the Code Inspection tab of the build results page.
The service message format is described below:
##teamcity[importData type='FxCop' path='<path to the xml file>']
The TeamCity agent will import the specified xml file in the background. Please make sure that the xml file is not deleted right after the
Concepts: Build Runner