ArcGIS Pro 2.9 API Reference Guide
SetMetadata Method (Layer)

ArcGIS.Desktop.Mapping Namespace > Layer Class : SetMetadata Method
The xml formatted metadata
Sets the Layer metadata. This method must be called on the MCT. Use QueuedTask.Run
Syntax
public override void SetMetadata( 
   string metadataXml
)
Public Overrides Sub SetMetadata( _
   ByVal metadataXml As String _
) 

Parameters

metadataXml
The xml formatted metadata
Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
There is a load or parse error in the XML
Metadata is missing metadata element
Remarks
The input xml must be a valid metadata document and, as a minimum, have a root <metadata> element. The Layer metadata must be editable. Refer to GetCanEditMetadata. Sub layer types do not support metadata. They typically have a single source, specified on the parent layer, that controls the metadata.
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

Layer Class
Layer Members