Search code examples
powershellmsbuildnunitteamcitydotcover

TeamCity dotCover without PDB files


I am running the following:

  • TeamCity Enterprise 7.1.5 (build 24400)
  • NUnit runner 2.6.2
  • dotCover (integrated)

I need to get dotCover to work, but due to the size of the solution there is a MS Build file responsible for the build and as part of that it removes the PDB files in the step before NUnit runs. The result is that dotCover cannot succeed as the PDBs are mandatory.

If I remove the line in the build file that deletes the PDBs, everything works. Unfortunately it has a build performance impact that means I am not allowed to remove it.

My next idea was to remove the line, allow the build step to complete, allow the NUnit step with dotCover to complete, then add a new step that removes those files (it is the OD2 deployment that has the biggest performance issue, not the build itself).

The problem with this is that I don't know what to put as the path in a powershell script:

Get-ChildItem -Path C:\[UNKNOWN PATH] -Include *.pdb -File -Recurse | foreach { $_.Delete()}

What path do I use? Is there a TC variable I can utilise? Alternatively can I get MSBuild to run NUnit with dotCover and then delete the files? Or is there a better solution entirely?

Open to any ideas.


Solution

  • Although I could not keep the PDB files for performance reasons, I was able to insert a new build step after the unit tests whose sole job was to delete the PDB files after the test step. I then deleted the line that deletes them in the primary build file.

    This means the PDBs are deleted and do not slow down OD, but they are present for dotCover.

    This has solved the issue.