This project is read-only.

Libraries Overview

CCI Metadata

The CCI Metadata library is packaged as a collection of DLLs, which have the same name as the corresponding project folder in the source tree, prefixed by Microsoft.Cci.

This section provides a brief overview of the contents and purpose of each DLL. For details, see the API reference help file, CCI_Metadata.chm, which is located in the source tree’s Documents folder.

Microsoft.Cci.MutableMetadataModel.dll and Microsoft.Cci.MetadataModel.dll

Microsoft.Cci.MutableMetadataModel.dll contains the set of concrete classes that support the CCI mutable metadata object model. The types are all in the Microsoft.Cci.MutableCodeModel namespace, which is a somewhat confusing historical artifact.

Microsoft.Cci.MetadataModel.dll defines the immutable metadata object model, which is a set of read-only interfaces that are exposed by the concrete classes of the mutable metadata model. The immutable metadata mode is essentially a read-only representation of the mutable model. The interfaces are all in the Microsoft.Cci namespace.

For further discussion, see Mutable and Immutable Representations.


The metadata model defines method bodies as a list of MSIL instructions. If you create a metadata model to be written out as a PE file, it must include the appropriate MSIL. You can use the mutable metadata model to create IL instructions directly, but this is somewhat tedious. To help with this task, Microsoft.Cci.ILGenerator.dll contains an ILGenerator class, which simplifies the process of creating IL instructions by handling details such as symbolic labels and exception blocks.

IlGenerator and associated classes are in the Microsoft.Cci namespace.


Microsoft.Cci.MetadataHelper.dll contains the metadata helper library. This library contains generally useful helper types that operate on a metadata model without any knowledge of how the model is implemented. The metadata helper library also contains a visitor base class, which includes virtual methods that can be overridden to create a custom visitor.

The metadata helper library types are in the Microsoft.Cci namespace, and a related set of data structures is in the Microsoft.Cci.UtilityDataStructures namespace.

Microsoft.Cci.PeReader.dll and Microsoft.Cci.PeWriter.dll

Microsoft.Cci.PeReader.dll contains a PeReader type, which you can use to parse a CLR portable executable (PE) file and represent its contents as an immutable metadata object model.

Microsoft.Cci.PeWriter.dll contains a PeWriter type which you can use to transform a metadata model to a .NET stream in the PE file format.

PeReader, PeWriter, and related types are in the Microsoft.Cci namespace.

Microsoft.Cci.PdbReader.dll and Microsoft.Cci.PdbWriter.dll

Microsoft.Cci.PdbReader.dll contains a PdbReader type, which you can use to parse a Program Database (PDB) file and represent the contents as a source object model.

Microsoft.Cci.PdbWriter.dll contains a PdbWriter type that you can use to transform a source model to a .NET file stream in the PDB file format.

PdbReader, PdbWriter, and related types are in the Microsoft.Cci namespace.


Microsoft.Cci.SourceModel.dll supports the source object model, which can be used to track which MSIL instruction corresponds to which source line, where source block scopes start and stop, the names of local variables, and so on.

The source model types are in the Microsoft.Cci namespace.

Last edited Dec 18, 2009 at 5:57 PM by Guy_Smith, version 3


No comments yet.