Including CLR Objects in Configuration
PostSharp includes a basic facility to describe CLR objects using XML. This facility is used to implement the Multicast and LoggingProfiles sections of the configuration file, and can be used to define custom sections.
The facility is consciously limited in features. It was only designed to provide the same features as custom attributes in programming languages.
This topic contains the following sections:
The basic rules apply to XML serialized objects:
The local name of the XML element must exactly match the type name of the CLR type. An exception to this rule is that the Attribute prefix can be omitted.
The XML namespace of the element must be in the form clr-namespace:namespace;assembly:assembly where namespace is the namespace of the CLR type and assembly is the name of the assembly declaring the type.
The type must have a public parameterless constructor.
Names of XML attributes must exactly match the name of a public field or property of the CLR type.
Values of XML attributes, mapping to CLR fields and properties, must be formatted according to the rule relevant for each type:
An intrinsic is any of the following types: bool, char, sbyte, byte, short, ushort, int, uint, long, ulong, float, double or string. Conversion is done using the Convert class.
A semicolon-separated list of elements.
A list of enumeration member names separated by characters | or +. Names in the list are combined using the + operator.
An assembly-qualified type name.
Fields and properties of type Object are not supported.