FileConfigurationExtensions.SetFileLoadExceptionHandler 方法

定义

设置在发生错误时为基于文件的提供程序调用的默认操作。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Configuration::IConfigurationBuilder ^ SetFileLoadExceptionHandler(Microsoft::Extensions::Configuration::IConfigurationBuilder ^ builder, Action<Microsoft::Extensions::Configuration::FileLoadExceptionContext ^> ^ handler);
public static Microsoft.Extensions.Configuration.IConfigurationBuilder SetFileLoadExceptionHandler (this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.FileLoadExceptionContext> handler);
static member SetFileLoadExceptionHandler : Microsoft.Extensions.Configuration.IConfigurationBuilder * Action<Microsoft.Extensions.Configuration.FileLoadExceptionContext> -> Microsoft.Extensions.Configuration.IConfigurationBuilder
<Extension()>
Public Function SetFileLoadExceptionHandler (builder As IConfigurationBuilder, handler As Action(Of FileLoadExceptionContext)) As IConfigurationBuilder

参数

builder
IConfigurationBuilder

要添加到的 IConfigurationBuilder

handler
Action<FileLoadExceptionContext>

要在文件加载异常时调用的操作。

返回

IConfigurationBuilder

适用于