HostingHostBuilderExtensions.RunConsoleAsync 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
오버로드
| 속성 | Description |
|---|---|
| RunConsoleAsync(IHostBuilder, CancellationToken) |
콘솔 지원을 사용하도록 설정하고 호스트를 빌드 및 시작하며 Ctrl+C 또는 SIGTERM이 종료되기를 기다립니다. |
| RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken) |
콘솔 지원을 사용하도록 설정하고 호스트를 빌드 및 시작하며 Ctrl+C 또는 SIGTERM이 종료되기를 기다립니다. |
RunConsoleAsync(IHostBuilder, CancellationToken)
콘솔 지원을 사용하도록 설정하고 호스트를 빌드 및 시작하며 Ctrl+C 또는 SIGTERM이 종료되기를 기다립니다.
[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);
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")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
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
콘솔을 취소하는 데 사용할 수 있는 A CancellationToken 입니다.
반품
Task 토큰이 트리거되거나 종료가 트리거될 때만 완료되는 A입니다.
- 특성
예외
취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.
적용 대상
RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)
콘솔 지원을 사용하도록 설정하고 호스트를 빌드 및 시작하며 Ctrl+C 또는 SIGTERM이 종료되기를 기다립니다.
[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);
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")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
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
콘솔을 취소하는 데 사용할 수 있는 A CancellationToken 입니다.
반품
Task 토큰이 트리거되거나 종료가 트리거될 때만 완료되는 A입니다.
- 특성
예외
취소 토큰이 취소되었습니다. 이 예외는 반환된 작업에 저장됩니다.