HostingHostBuilderExtensions.RunConsoleAsync 메서드

정의

오버로드

RunConsoleAsync(IHostBuilder, CancellationToken)

콘솔 지원을 구현하고, 호스트를 빌드 및 시작하며, Ctrl+C 또는 SIGTERM이 종료될 때까지 기다립니다.

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

콘솔 지원을 구현하고, 호스트를 빌드 및 시작하며, Ctrl+C 또는 SIGTERM이 종료될 때까지 기다립니다.

RunConsoleAsync(IHostBuilder, CancellationToken)

Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
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)

Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
HostingHostBuilderExtensions.cs
Source:
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입니다.

특성

예외

취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.

적용 대상