Processing the XML File (Visual Basic)

11/24/2013

2 minutes to read

In this article

The compiler generates an ID string for each construct in your code that is tagged to generate documentation. (For information on how to tag your code, see Recommended XML Tags for Documentation Comments (Visual Basic).) The ID string uniquely identifies the construct. Programs that process the XML file can use the ID string to identify the corresponding .NET Framework metadata/reflection item.

The XML file is not a hierarchical representation of your code; it is a flat list with a generated ID for each element.

The compiler observes the following rules when it generates the ID strings:

No white space is placed in the string.

The first part of the ID string identifies the kind of member being identified, with a single character followed by a colon. The following member types are used.

Character

Description

N

namespace

You cannot add documentation comments to a namespace, but you can make CREF references to them, where supported.

T

type: Class, Module, Interface, Structure, Enum, Delegate

F

field: Dim

P

property: Property (including default properties)

M

method: Sub, Function, Declare, Operator

E

event: Event

!

error string

The rest of the string provides information about the error. The Visual Basic compiler generates error information for links that cannot be resolved.

The second part of the String is the fully qualified name of the item, starting at the root of the namespace. The name of the item, its enclosing type(s), and the namespace are separated by periods. If the name of the item itself contains periods, they are replaced by the number sign (#). It is assumed that no item has a number sign directly in its name. For example, the fully qualified name of the String constructor would be System.String.#ctor.

For properties and methods, if there are arguments to the method, the argument list enclosed in parentheses follows. If there are no arguments, no parentheses are present. The arguments are separated by commas. The encoding of each argument follows directly how it is encoded in a .NET Framework signature.

Example

The following code shows how the ID strings for a class and its members are generated.