We're using Mono.Cecil in our project. Does it have any functionality that allows me to check whether a specific PDB and DLL match?
Thanks!
We're using Mono.Cecil in our project. Does it have any functionality that allows me to check whether a specific PDB and DLL match?
Thanks!
Cecil doesn't expose an API to test whether a pdb and a dll match. However, it does a check when you read an assembly, and try to read its symbols.
But what does it mean exactly for a pdb to match a module?
It means that the pdb and the module share a record containing the exact same GUID identifier, and revision number of the pdb (also named age).
Sometimes you want to only check the GUID, sometimes you want to check both. Cecil by itself doesn't provide you with a way to override the default behavior, but it's a very easy change. Have a look at the source of the PdbReader.
Currently the check is in PopulateFunctions, and we're currently not enforcing that the age of the pdb must be same one that the debug record in the assembly. You can easily change that to something more to your taste.
Or you can use another tool entirely: I've been using chkmatch with satisfaction.