Redigera

Dela via


EventProvider.SetActivityId(Guid) Method

Definition

Sets the current activity identifier used by the WriteEvent methods.

public:
 static void SetActivityId(Guid % id);
[System.Security.SecurityCritical]
public static void SetActivityId (ref Guid id);
[<System.Security.SecurityCritical>]
static member SetActivityId : Guid -> unit
Public Shared Sub SetActivityId (ByRef id As Guid)

Parameters

id
Guid

A unique activity identifier that the CreateActivityId() method returns.

Attributes

Remarks

The identifier is stored in the thread context.

Note that in version 3.5 of the .NET framework, you had to set the id parameter of this method and the ActivityId property value to the same identifier value. However, in version 4.0 of the framework, the SetActivityId method automatically sets the correlation activity identifier for you.

This is a static method.

Applies to