HostingAbstractionsWebHostBuilderExtensions.CaptureStartupErrors 方法

定义

设置是否应在 Web 主机的配置设置中捕获启动错误。 启用后,将捕获启动异常并返回错误页。 如果禁用,将传播启动异常。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ CaptureStartupErrors(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, bool captureStartupErrors);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder CaptureStartupErrors (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, bool captureStartupErrors);
static member CaptureStartupErrors : Microsoft.AspNetCore.Hosting.IWebHostBuilder * bool -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function CaptureStartupErrors (hostBuilder As IWebHostBuilder, captureStartupErrors As Boolean) As IWebHostBuilder

参数

hostBuilder
IWebHostBuilder

要配置的 IWebHostBuilder

captureStartupErrors
Boolean

true 使用启动错误页;否则为 false

返回

IWebHostBuilder

适用于