HostingAbstractionsWebHostBuilderExtensions.CaptureStartupErrors Method

Definition

Set whether startup errors should be captured in the configuration settings of the web host. When enabled, startup exceptions will be caught and an error page will be returned. If disabled, startup exceptions will be propagated.

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

Parameters

hostBuilder
IWebHostBuilder

The IWebHostBuilder to configure.

captureStartupErrors
Boolean

true to use startup error page; otherwise false.

Returns

IWebHostBuilder

The IWebHostBuilder.

Applies to