How do I enable PartCover code coverage with MSBuild task in TeamCity 5.0?

I am confused as to the steps I need to take to enable PartCover code coverage reporting for MSBuild build configuration in TeamCity 5.0.1.

I read this:

Which led me to update my MSBuild file to this:

  <Target Name="UnitTest">
    <CreateItem Include="$(BinaryDirectory)/*.Test.dll">
      <Output ItemName="UnitTestAssemblies" TaskParameter="Include" />
    <Exec Command="$(teamcity_dotnet_nunitlauncher) v2.0 x86 NUnit-2.4.1 /partcover:&quot;C:\Program Files\Gubka Bob\PartCover .NET 2.3\PartCover.exe&quot; /partcover-arg:--output /partcover-arg:c:\Temp\result.xml @(UnitTestAssemblies)"

This works (with the exception that the script keeps going when tests fail).  But there are no code coverage results.  Then I found the configuration settings in the MSBuild section:

I could not find any help on this, and attempts to guess on how I should configure this failed.

Could you provide clear instructions on how I would enable PartCover code coverage for TeamCity 5.0?


  • What I need installed on the Build Agents
  • What changes I need to make to the MSBuild file, whether tests run in there need special handling to run PartCover
  • What changes I need to make to the build configuration
1 comment
Comment actions Permalink


t800t8 wrote:

The 'Code Coverage' field is for Java, if you change build runner to Ipr or Ant, you will see it.


Please sign in to leave a comment.