Bagikan melalui


HostingAbstractionsWebHostBuilderExtensions.CaptureStartupErrors Metode

Definisi

Atur apakah kesalahan startup harus diambil di pengaturan konfigurasi host web. Saat diaktifkan, pengecualian startup akan tertangkap dan halaman kesalahan akan dikembalikan. Jika dinonaktifkan, pengecualian startup akan disebarluaskan.

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

Parameter

hostBuilder
IWebHostBuilder

untuk IWebHostBuilder mengonfigurasi.

captureStartupErrors
Boolean

true untuk menggunakan halaman kesalahan startup; jika tidak false.

Mengembalikan

IWebHostBuilder.

Berlaku untuk