How can I use Mono.Cecil to check the compliance of .pdb and .dll files?

We use Mono.Cecil in our project. Does it have any functionality that allows me to check for a specific PDB and DLL?

Thanks!

+4
source share
1 answer

Cecil does not provide an API for checking pdb and dll compliance. However, it checks when you read the assembly and try to read its symbols.

But what exactly means for pdb to match the module?

This means that pdb and the module share a record containing the exact GUID and the pdb version number (also named age).

Sometimes you only want to check the GUID, sometimes you want to check both. Cecil alone does not provide you with a way to override the default behavior, but it is a very simple change. Look at the source of PdbReader .

Currently, validation is performed in PopulationFunctions, and currently we are not observing that the pdb age must be the same as the debug record in the assembly. You can easily change this to something more to your liking.

Or you can use another tool entirely: I enjoyed using chkmatch .

+5
source

Source: https://habr.com/ru/post/1393797/


All Articles