Share via


TelemetrySession.TryAddCommonProperty(String, Object) Method

Definition

Attempts to add a single property key and value that may be common to all events for the session but should not have the Context prefix. Properties are not persisted between sessions. To add multiple properties see AddCommonPropertyRange(IDictionary<String,Object>)

public bool TryAddCommonProperty (string propertyName, object propertyValue);
member this.TryAddCommonProperty : string * obj -> bool
Public Function TryAddCommonProperty (propertyName As String, propertyValue As Object) As Boolean

Parameters

propertyName
String
propertyValue
Object

Returns

true if the key/value pair was added, false if the key already existed.

Exceptions

Thrown when properties, key, or value is null

Thrown when property key or value is null

Applies to