Activity.Id Property

Definition

Gets an identifier that is specific to a particular request.

C#
public string? Id { get; }
C#
public string Id { get; }

Property Value

The activity ID.

Remarks

An ID has a hierarchical structure: root-id.id1_id2.id3_. The ID is generated when Start() is called by appending a suffix to the Activity.Parent.Id or the ParentId. An Activity has no ID until it starts. For more information, see Activity IDs.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)