The following sections describe attributes, child elements, and parent elements.
Attributes
Attribute
Attribute type
Description
Name
General
Required attribute. Specifies the name of the namespace.
Activate
Reflection
Optional attribute. Controls runtime access to constructors to enable activation of instances.
Browse
Reflection
Optional attribute. Controls querying for information about program elements, but does not enable any runtime access.
Dynamic
Reflection
Optional attribute. Controls runtime access to all type members, including constructors, methods, fields, properties, and events, to enable dynamic programming.
Serialize
Serialization
Optional attribute. Controls runtime access to constructors, fields, and properties, to enable type instances to be serialized and deserialized by libraries such as the Newtonsoft JSON serializer.
Optional attribute. Controls policy for marshaling reference types to Windows Runtime and COM.
MarshalDelegate
Interop
Optional attribute. Controls policy for marshaling delegate types as function pointers to native code.
MarshalStructure
Interop
Optional attribute. Controls policy for marshaling structures to native code.
Name attribute
Value
Description
namespace_name
The namespace name. If the <Namespace> element is a child of an <Application>, <Library>, or <Assembly> element, namespace_name must be a fully qualified namespace name. If the <Namespace> element is a child of another <Namespace> element, namespace_name must be a relative namespace name.
All other attributes
Value
Description
policy_setting
The setting to apply to this policy type for all types in the namespace. Possible values are All, Auto, Excluded, Public, PublicAndInternal, Required Public, Required PublicAndInternal, and Required All. For more information, see Runtime Directive Policy Settings.
Child Elements
Element
Description
<Namespace>
Applies runtime reflection policy to all types in a parent namespace.
Serves as a container for application-wide types and type members whose metadata is available for reflection at run time. The <Application> element can have zero, one, or more <Assembly> elements.
Defines the assembly that contains types and type members whose metadata is available for reflection at run time. The <Library> element can have zero or one <Assembly> element.
<Namespace>
Applies reflection policy to all types in a parent namespace.
Remarks
The Activate, Browse, Dynamic, and Serialize attributes are all optional. If none are present, the <Namespace> element serves only as a container for child elements. If they are present, the <Namespace> element applies runtime reflection policy to all the types in the specified namespace.
When it is a child of the <Assembly> element, the <Namespace> element overrides the runtime reflection policy defined by the <Assembly> element.