How to check if pdb file is valid for debugging assembly

I am writing some kind of logic for an academic source of characters.

I need to check the assembly and pdb file if they match each other so that users can use them without any problems.

Ive done a little research, but without anything impressive. If VS receives incorrect character debugging, it may display information:

The following module was built either with or without optimization debugging information: assembly.dll
to debug this module, change its project, build the configuration in debug mode. to suppress this message, disable the "Warn if user code at startup" debugger.

Im also interested in what information VS gets from pdb and build to check them out.

Is there any (managed) API? Or even uncontrollable?

Any ideas?

+5
source share
2 answers

I think the Visual Studio API name uses the DIA; it is a COM API that you can call from C #.

The Mono.Cecil library provides a good set of classes for accessing assemblies and their symbols; it uses DIA under .pdb files. I would call Cecil directly for this; if not, the source code should contain a guide.

+2
source
+2