Method StartAsync
StartAsync()
Starts this LocalFeatureService instance on the LocalServer. The StartCompleted event is called when the service creation is complete.
Declaration
public override Task StartAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous start operation. |
Overrides
Remarks
There are a number of patterns available when working with the StartAsync method. The most concise approach is to use the overloaded StartAsync(Action<LocalFeatureService>) method in conjunction with a lambda expression. Alternatively lambda expressions can be used with the StartCompleted event and the default parameterless Start method. Lastly, it is also possible to use a separate named event handler registered with the StartCompleted event if required.
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Windows | 100.13 - 200.6 |
.NET Framework | 100.0 - 200.6 |
StartAsync(CancellationToken)
Starts this LocalFeatureService instance on the LocalServer. The StartCompleted event is called when the service creation is complete.
Declaration
public override Task StartAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | The token to monitor for cancellation requests. The default value is System.Threading.CancellationToken.None. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the asynchronous start operation. |
Overrides
Remarks
There are a number of patterns available when working with the StartAsync method. The most concise approach is to use the overloaded StartAsync(Action<LocalFeatureService>) method in conjunction with a lambda expression. Alternatively lambda expressions can be used with the StartCompleted event and the default parameterless Start method. Lastly, it is also possible to use a separate named event handler registered with the StartCompleted event if required.
Exceptions
Type | Condition |
---|---|
System.Threading.Tasks.TaskCanceledException | The operation was cancelled |
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Windows | 100.13 - 200.6 |
.NET Framework | 100.13 - 200.6 |