TraceConfiguration.CreateTraceConfigurationInstanceAsync Method
Definition
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.
Overloads
CreateTraceConfigurationInstanceAsync(IServiceBroker, CancellationToken) |
Obsolete.
This will create an ITraceHubRegistrationService instance that can be used to call RegisterLogSourceAsync(LogId, LoggerOptions, TraceSource, CancellationToken). |
CreateTraceConfigurationInstanceAsync(IServiceBroker, Boolean, CancellationToken) |
This will create an ITraceHubRegistrationService instance that can be used to call RegisterLogSourceAsync(LogId, LoggerOptions, TraceSource, CancellationToken). |
CreateTraceConfigurationInstanceAsync(IServiceBroker, CancellationToken)
Caution
Use CreateTraceConfigurationInstanceAsync method with ownsServiceBroker parameter.
This will create an ITraceHubRegistrationService instance that can be used to call RegisterLogSourceAsync(LogId, LoggerOptions, TraceSource, CancellationToken).
[System.Obsolete("Use CreateTraceConfigurationInstanceAsync method with ownsServiceBroker parameter.")]
public static System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.LogHub.TraceConfiguration> CreateTraceConfigurationInstanceAsync (Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Use CreateTraceConfigurationInstanceAsync method with ownsServiceBroker parameter.")>]
static member CreateTraceConfigurationInstanceAsync : Microsoft.ServiceHub.Framework.IServiceBroker * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.LogHub.TraceConfiguration>
Public Shared Function CreateTraceConfigurationInstanceAsync (serviceBroker As IServiceBroker, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TraceConfiguration)
Parameters
- serviceBroker
- IServiceBroker
The IServiceBroker handle to access Visual Studio services. The generated TraceConfiguration will take ownership of this object.
- cancellationToken
- CancellationToken
The CancellationToken.
Returns
ValueTask<TResult> which may be awaited to retrieve the generated TraceConfiguration
- Attributes
Applies to
CreateTraceConfigurationInstanceAsync(IServiceBroker, Boolean, CancellationToken)
This will create an ITraceHubRegistrationService instance that can be used to call RegisterLogSourceAsync(LogId, LoggerOptions, TraceSource, CancellationToken).
public static System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.LogHub.TraceConfiguration> CreateTraceConfigurationInstanceAsync (Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, bool ownsServiceBroker, System.Threading.CancellationToken cancellationToken = default);
static member CreateTraceConfigurationInstanceAsync : Microsoft.ServiceHub.Framework.IServiceBroker * bool * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.VisualStudio.LogHub.TraceConfiguration>
Public Shared Function CreateTraceConfigurationInstanceAsync (serviceBroker As IServiceBroker, ownsServiceBroker As Boolean, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TraceConfiguration)
Parameters
- serviceBroker
- IServiceBroker
The IServiceBroker handle to access Visual Studio services. This is used to access a non-local TraceHub.
- ownsServiceBroker
- Boolean
Indicates whether or not the resulting TraceConfiguration owns the IServiceBroker provided to it.
When set to true
the returned TraceConfiguration will dispose of the provided
IServiceBroker when Dispose() is called.
When set to false
the provided IServiceBroker will not be automatically disposed.
- cancellationToken
- CancellationToken
The CancellationToken.
Returns
ValueTask<TResult> which may be awaited to retrieve the generated TraceConfiguration