HostingHostBuilderExtensions.RunConsoleAsync メソッド

定義

オーバーロード

RunConsoleAsync(IHostBuilder, CancellationToken)

コンソールのサポートを有効にし、ホストをビルドして開始した後、Ctrl + C または SIGTERM がシャットダウンするのを待機します。

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

コンソールのサポートを有効にし、ホストをビルドして開始した後、Ctrl + C または SIGTERM がシャットダウンするのを待機します。

RunConsoleAsync(IHostBuilder, CancellationToken)

ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs

コンソールのサポートを有効にし、ホストをビルドして開始した後、Ctrl + C または SIGTERM がシャットダウンするのを待機します。

public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function RunConsoleAsync (hostBuilder As IHostBuilder, Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

hostBuilder
IHostBuilder

構成する IHostBuilder

cancellationToken
CancellationToken

コンソールのキャンセルに使用できる CancellationToken

戻り値

トークンがシグナルされたとき、またはアプリケーションがシャットダウンされたときにのみ完了する Task

属性

例外

キャンセル トークンが取り消されました。 この例外は、返されたタスクに格納されます。

適用対象

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs
ソース:
HostingHostBuilderExtensions.cs

コンソールのサポートを有効にし、ホストをビルドして開始した後、Ctrl + C または SIGTERM がシャットダウンするのを待機します。

public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions, System.Threading.CancellationToken cancellationToken = default);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions, System.Threading.CancellationToken cancellationToken = default);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function RunConsoleAsync (hostBuilder As IHostBuilder, configureOptions As Action(Of ConsoleLifetimeOptions), Optional cancellationToken As CancellationToken = Nothing) As Task

パラメーター

hostBuilder
IHostBuilder

構成する IHostBuilder

configureOptions
Action<ConsoleLifetimeOptions>

ConsoleLifetimeを構成するためのデリゲート。

cancellationToken
CancellationToken

コンソールのキャンセルに使用できる CancellationToken

戻り値

トークンがシグナルされたとき、またはアプリケーションがシャットダウンされたときにのみ完了する Task

属性

例外

キャンセル トークンが取り消されました。 この例外は、返されたタスクに格納されます。

適用対象