dotCover says "document has been changed"

Completed

I'm getting "faded" coverage indicators in Visual Studio together with this tooltip:

But I checked, and I'm pretty sure I'm using the same source code as what was used on my build server to build the PDB files that dotCover used.

Steps in my sequence:

  1. Check out code on build server
  2. Build assembly + PDB
  3. Run assembly + PDB locally through dotCover
  4. Save coverage file
  5. Check out same code locally
  6. Open coverage file in Visual Studio

This is my first time setting this up, so I'm not sure if I've missed something.

  • How does dotCover know that the document has changed?
  • What should I do to fix my sequence?
3 comments

Hello Dan,

I'm terribly sorry for such a long delay!

dotCover compares actual checksums (MD5 and SHA1) of source code files with those that have been written to PDB during the build. Such details as encoding and line endings are taken into account when checksums are being calculated.

Could you please try to check that checksums of source code files on your build server are exactly the same as those on your local machine? Some of on-line hash-calculators can be used for this, e.g. http://onlinemd5.com.

1

Hi Ekaterina,

No worries! Thank you for the detailed response. With your information, I was able to solve the problem.

In my case, the PDB files included SHA1 checksums of my source files. The Microsoft command-line tool "cvdump" wasn't able extract this information from the managed .NET PDB, but a tool called "IsItMySource" that I found on GitHub was able to do the job.

Using the list of source files and checksums, I verified that the file used by TeamCity for compiling the build matched the checksum while my local file did not match. (I used PowerShell's "Get-FileHash MyFile.cs -Algorithm SHA1" to compute the hashes.)

The problem was that the default settings for Visual Studio are to use Git's autocrlf feature, but the TeamCity VCS Root had CRLF checkouts disabled for this Git repository. This is the TeamCity setting that I needed to change:

After making this change and generating a new assembly + PDB, all of the DotCover annotations now show up in bright grey/green, without any warnings that the source files are out of date.

0

Hi Dan,

Thanks a lot for the details! Glad to hear that it works now.

1

Please sign in to leave a comment.