0

I am trying to analyse some assemblies with NDepend but it complains that the pdb files and source files are not in sync with each other. However, the development and compilation of the assemblies has occured on the same server as where I am running NDepend from.

How can I fix this? I've seen a lot of people have this problem, from googling, but no real solutions. Also, I will be running NDepend on another server (automated build server) from the dev server, so in the future, I am likely to have the same problem again. Looking at NDepend's documentation, the path to where the source is stored must always be the same (but I never broke this rule).

Would a recompilation of the assembly fix this? How serious is this problem?

Thanks

GurdeepS
  • 65,107
  • 109
  • 251
  • 387

1 Answers1

2

NDepend emits a 'PDB files and source not in sync' simply when it detects that a source file referenced by a PDB file has a more recent LastWriteTime than the PDB file. So if your build process somehow updates the LastWriteTime of your source file after compilation and before NDepend analysis this can be a false alarm, although changing the LastWriteTime of your source file after compilation sounds awkward.

A better heuristic could be to harness source files checksums contained in PDB file. By using this checksum NDepend could see if the source file content has been changed. This is how VS is working btw at debugging time. We (the NDepend Team) haven't implement this heuristic because it could be costly and the simple heuristic based on LastWriteTime is enough for most of real-world cases.

Patrick - NDepend Team

Patrick from NDepend team
  • 13,237
  • 6
  • 61
  • 92
  • Any idea where to find the checksums for the source files in a pdb? See http://stackoverflow.com/questions/17120215/how-does-visual-studio-know-if-the-source-file-matches-the-original-version-c-s – Cameron Taggart Jun 15 '13 at 05:29
  • Not sure if Mono.Cecil.PDB or MS CCI PDB have this feature now? Just check it: http://ccimetadata.codeplex.com/discussions/topics/4673/pdb-reader – Patrick from NDepend team Jun 17 '13 at 08:43
  • I found the MD5 checksums. I was able to modify the MS CCI PDB code to get to them. I don't understand why everything in that code base is marked as internal. I'm probably going to write my own reader. – Cameron Taggart Jun 17 '13 at 14:20