CorrelationManager.StartLogicalOperation Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Starts a logical operation on a thread.
StartLogicalOperation() |
Starts a logical operation on a thread. |
StartLogicalOperation(Object) |
Starts a logical operation with the specified identity on a thread. |
- Source:
- CorrelationManager.cs
- Source:
- CorrelationManager.cs
- Source:
- CorrelationManager.cs
Starts a logical operation on a thread.
public:
void StartLogicalOperation();
public void StartLogicalOperation ();
member this.StartLogicalOperation : unit -> unit
Public Sub StartLogicalOperation ()
Remarks
The logical operation is started using an automatically generated GUID for a logical operation identifier.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- CorrelationManager.cs
- Source:
- CorrelationManager.cs
- Source:
- CorrelationManager.cs
Starts a logical operation with the specified identity on a thread.
public:
void StartLogicalOperation(System::Object ^ operationId);
public void StartLogicalOperation (object operationId);
member this.StartLogicalOperation : obj -> unit
Public Sub StartLogicalOperation (operationId As Object)
Parameters
- operationId
- Object
An object identifying the operation.
Exceptions
The operationId
parameter is null
.
Examples
The following code example demonstrates the use of the StartLogicalOperation(Object) method by initializing a logical operation to be associated with the main thread. For the complete code example, see the CorrelationManager class.
TraceSource ts = new TraceSource("MyApp");
int i = ts.Listeners.Add(new ConsoleTraceListener());
ts.Listeners[i].TraceOutputOptions = TraceOptions.LogicalOperationStack;
ts.Switch = new SourceSwitch("MyAPP", "Verbose");
// Start the logical operation on the Main thread.
Trace.CorrelationManager.StartLogicalOperation("MainThread");
Dim ts As New TraceSource("MyApp")
Dim i As Integer = ts.Listeners.Add(New ConsoleTraceListener())
ts.Listeners(i).TraceOutputOptions = TraceOptions.LogicalOperationStack
ts.Switch = New SourceSwitch("MyAPP", "Verbose")
' Start the logical operation on the Main thread.
Trace.CorrelationManager.StartLogicalOperation("MainThread")
Remarks
The operationId
parameter can be any object, such as a String that allows the operation to be identified for tracing purposes. The object represented by operationId
is added to the LogicalOperationStack property.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: