Hi,
I would like to access .net debugging data that stored in pdb's using
C#. I found the ISysWrapper assembly, which provices access to the
System.Diagnostics.SymbolStore implementation, but cannot for the life
of me figure out how to properly invoke "SysBinder.GetReader(int
importer, string filename, string search path)" method correctly.
Here is what I have:
SymBinder binder = new SymBinder();
binder.GetReader(???,"mydll.dll,"c:\\");
The "int importer" parameter is documented as "The metadata import
interface", which I know refers to cor.h's IMetaDataImport interface.
But I cannot find an implementation of the IMetaDataImport interface
to use... Can anyone help?
Joe Betz
Jennifer Hamilton [MSFT] - 10 Oct 2003 19:39 GMT
There are no managed wrappers for the IMetaDataImport interface. You need
to use COM interop. The following code snippet should help:
// GUIDs Copied from Cor.h
IMetaDataDispenser mdd =
(IMetaDataDispenser)Activator.CreateInstance(Type.GetTypeFromCLSID(
new Guid("e5cb7a31-7512-11d2-89ce-0080c792e5d8")));
Guid IID_IMetadataImport = new
Guid("7DAC8207-D3AE-4c75-9B67-92801A497D44");
IntPtr importer;
mdd.OpenScope(fn, 0, ref IID_IMetadataImport, out importer);
Jennifer Hamilton
CLR Base Services Development Team

Signature
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.