Code coverage using Dotcover

we use MbUnit for Unit Testing (Gallio)
They are running fine in Teamcity through msbuild, it is also showing correct Test results

I want is code coverage with that tests
We have diffenrent type of projects some are just DLL base (do not have excutable) and some are executable

So we want code coverage using dot cover, through the teamcity
Please guide me through it

Comment actions Permalink


DotCover is not compatible with Gallio at the moment. Please watch/vote for DCVR-1343.


Comment actions Permalink

Hi thnx for your reply

then is there anyway so that we can use Code coverage for MbUnit test cases while building projects through Teamcity via msbuild

and in which version will dotcover be compatible with gallio??

Comment actions Permalink

I think TeamCity 6.0.2 currently only supports tests that are run with NUnit. At least that is what it says when configuring dotCover.


Comment actions Permalink

Please see
for details how to post customly created snapshots to TeamCity.
I believe it could be possible to make Gallio TeamCity plugin to post service messages with dotCover created snaphot file paths.

At the end of the build TeamCity will merge all reported snapshots, generate HTML report and publish statistic values.

Comment actions Permalink

but my main problem is that dotcover is not able to do Code coverage for MbUnit Test Cases
Is there any way for it?

Comment actions Permalink

Gallio/MBUnit testing framework start child processes to execute unit tests. Please refer to Gallio documentation to know how to make Gallio running code coverage. There should be commandline arguments for it.

Comment actions Permalink

Hi thnx for ur reply
i am now able to generate output.xml containing codecoverage results, i am using folllowing target

<Target Name="CodeCoverage">
      <DotCoverPath>C:\Program Files\JetBrains\dotCover\v1.0\Bin\dotCover.exe</DotCoverPath>
       <AnalyseFile>C:\CI Build\Products\Code\analyse.xml</AnalyseFile>
      <OutputXmlPath>C:\CI Build\Products\Code\Output.xml</OutputXmlPath>

    <Exec Command="&quot;$(DotCoverPath)&quot; c &quot;$(AnalyseFile)&quot;" ContinueOnError="true"></Exec>

    <Message Text="##teamcity[importData type='dotNetCoverage' tool='dotcover' path='$(OutputXmlPath)']"></Message>

But  reports are not getting seen in TeamCity.. as it should be shown in Code Coverage tab (Tab has not been created)

Following is the Log Shown in Teamcity Build

[11:31:43]: Importing data from 'C:\CI Build\Products\Code\Output.xml' with 'dotNetCoverage' processor
[11:31:43]: Process exited with code 0
[11:31:43]: Waiting for 1 service processes to complete
[11:31:43]: Processing 1 coverage report(s)
[11:31:43]: Generating coverage report by dotcover for files: [C:\CI Build\Products\Code\Output.xml]
[11:31:43]: Failed to find: null
[11:31:43]: Publishing artifacts
[11:31:43]: [Publishing artifacts] Paths to publish: [teamcity-info.xml]
[11:31:43]: [Publishing artifacts] Sending files
[11:32:33]: Build finished

Can you Please help...
Comment actions Permalink

Could you please try upgrating to latest dotCover 1.1 EAP build.

Comment actions Permalink


Following is the Log seen (end of it) when i run the Dotcover from commandline

  Disposing the test runner.
  Stop time: 12:15 PM (Total execution time: 491.033 seconds)

  654 run, 646 passed, 8 failed, 0 inconclusive, 0 skipped

  Analysed application exited with code '1'
  Coverage session finished [3/23/2011 12:15:19 PM]
  Snapshot merging started [3/23/2011 12:15:19 PM]
  Source snapshots number: 2
  Merging snapshots 1-2
  Snapshot merging failed [3/23/2011 12:15:19 PM]. Null AssemblyName

So i dont get the XML or HTML report
What may be the problem??

Comment actions Permalink

Hello Chittoori,
Could you please try the following:
- download dotCover build from our nightly builds page
- run it with additional parameter /LogFile=path_to_the_log_file
- in case if coverage analysis will not succeed, please send us that log to with subject containing "dotCover" word.
Thanks in advance.

Comment actions Permalink

Hi Chittoori:

Do you still remember where the analyse.xml file comes from? I am trying to do the same as you did. but I don't know what is in the analyse.xml file and where it comes from.




Please sign in to leave a comment.