WebHostBuilderKestrelExtensions.UseKestrelCore(IWebHostBuilder) 方法

定義

將 Kestrel 指定為 Web 主機要使用的伺服器。 包含的自動功能比 UseKestrel(IWebHostBuilder) 讓修剪更有效率 (,例如原生 AOT 案例) 。 如果主機最終取決於某些不存在的功能,則會嘗試視需要啟用它。 失敗,啟動主機時,將會引發具有資訊性錯誤訊息的例外狀況。

public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseKestrelCore (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder);
static member UseKestrelCore : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function UseKestrelCore (hostBuilder As IWebHostBuilder) As IWebHostBuilder

參數

hostBuilder
IWebHostBuilder

要設定的 Microsoft.AspNetCore.Hosting.IWebHostBuilder。

傳回

Microsoft.AspNetCore.Hosting.IWebHostBuilder。

適用於