FileConfigurationExtensions.SetFileLoadExceptionHandler Method

Definition

Sets a default action to be invoked for file-based providers when an error occurs.

C#
public static Microsoft.Extensions.Configuration.IConfigurationBuilder SetFileLoadExceptionHandler(this Microsoft.Extensions.Configuration.IConfigurationBuilder builder, Action<Microsoft.Extensions.Configuration.FileLoadExceptionContext> handler);

Parameters

handler
Action<FileLoadExceptionContext>

The Action to be invoked on a file load exception.

Returns

The IConfigurationBuilder.

Applies to

Производ Верзије
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided)