This page last changed on Jan 16, 2005 by mroberts.

Run FxCop as part of your integration

Run FxCop as part of your NAnt build

In order to get the results of FxCop included in the CruiseControl.NET build results, you will need to include a call to FxCopCmd.exe in your NAnt build file. We recommend you use a target like this:

<target name="reporting" depends="compile">
	<exec program="tools\fxcop\fxcopcmd.exe" 
		commandline="/p:tools\fxcop\ccnet.fxcop /o:build\fxcop\ccnet-fxcop.xml" failonerror="false"/>
</target>

Run "FxCopCmd /?" in order to see what command-line options are supported. We recommend setting up an FxCop project for analysing your assemblies. You should use the "/o" argument in order to output the FxCop report to an Xml file. It is also a good idea to set "failonerror" to false for the task. FxCop may fail depending on the rule violations, but you probably don't want this to break your build.

For a thorough example, look at the CruiseControl.NET source distribution and look at how we use FxCop ourselves.

Run FxCop as a CruiseControl.NET Task

We don't currently support running FxCop directly from CruiseControl.NET, but we plan on enabling this in a later release.

Merge FxCop results into your CruiseControl.NET results

The next step is to merge the FxCop report file into the integration result using the File Merge Task. Your CruiseControl.NET Server config file will have something in it like :

<tasks>
    <merge>
        <files>
            <file>d:\sourceforge\ccnet\build\fxcop\*.xml</file>
            <!-- Other files to merge for your build would also be included here -->
      	</files>
    </merge>
</tasks>

Configuring your Reporting Application to display FxCop results

For displaying the results, CruiseControl.NET currently supports FxCop 1.312.

If you are using the Web Dashboard, edit your web.config file and include the fxcop-summary.xsl file under the <CCNET>/<xslFiles> section, and the ThoughtWorks.CruiseControl.WebDashboard.Plugins.FxCop.FxCopReportBuildPlugin Build Plugin.

If you are using Project Report Web Application, edit your web.config file and include the fxcop-summary.xsl file under the <CCNET>/<xslFiles>, and the FxCop.aspx Build Plugin.

Document generated by Confluence on Jan 23, 2011 08:52