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 |
|---|---|
| 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 6.0 Windows | 100.13 - 100.15 |
| .NET Framework | 100.0 - 100.15 |
| .NET 5 | 100.10 - 100.12 |
| .NET Core 3.1 | 100.7 - 100.12 |
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 |
|---|---|---|
| CancellationToken | cancellationToken | The token to monitor for cancellation requests. The default value is System.Threading.CancellationToken.None. |
Returns
| Type | Description |
|---|---|
| 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 6.0 Windows | 100.13 - 100.15 |
| .NET Framework | 100.13 - 100.15 |