HostingAbstractionsWebHostBuilderExtensions.CaptureStartupErrors 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
设置是否应在 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
。