TeamCity - I don't understand dotNetCoverage.dotCover.source.mapping

I am having trouble getting source code to show up in a dotCover build step. I fiddled around with the parameter dotNetCoverage.dotCover.source.mapping, to no avail. However, I don't exactly understand what path I need to map to what.

I have set up TeamCity to run on a rather complicated (pre-existing) build system. I had to do all checkouts using the SVN command line tools instead of using the TeamCity SVN functionality. This all works fine, except for dotCover.

DotCover is run from a separate configuration, with three build steps:

  1. Command line step to call "svn,exe", which does a checkout on the directory c:\dev\trunk\ABC\DEF
  2. Command line step that calls "nant.exe", this compiles all the assemblies in c:\dev\trunk\ABC\DEF, it also produces the DLLs
    • C:\dev\trunk\ABC\DEF\Tests\UnitTests\bin\Release\UnitTests.dll - this contains the unit tests
    • C:\dev\trunk\ABC\DEF\Tests\UnitTests\bin\Release\XYZ.dll - this is the assembly that is being tested by the unit tests
  3. Nunit, which runs the tests UnitTests.dll and is configured to use dotCover

A code coverage report is produced, with data, but it all pages eventually lead to "Source code is not available".

After some searching on this site, I have added a configuration parameter

dotNetCoverage.dotCover.source.mapping C:\dev\trunk\ABC\DEF=>

which seemed counterintuitive, but appears to have some effect. If I now browse to a source file in the code coverage report, the error changed to (e.g.):

   Failed to load file: C:\TeamCity\buildAgent\work\7b4a15d36428a742\source\XYZ\formulaengine\actualindexcalculator.cs

Which I take to mean that the original file name


has been remapped to the new path.

However, it should just be using the original path - without remapping. I checked the TeamCity server and the file exists.

If I remove the configuration parameter again, I am back to  "Source code is not available"..

Many thanks,

Please sign in to leave a comment.