共用方式為


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

適用於