Edit

FileConfigurationProvider doesn't raise reload token after ignored load failure

FileConfigurationProvider no longer calls OnReload or fires its reload token after Load() fails and its OnLoadException callback ignores the exception.

Version introduced

.NET 11 Preview 7

Previous behavior

Previously, after Load failed and the OnLoadException callback set Ignore to true, FileConfigurationProvider called OnReload. The reload token returned by GetReloadToken() fired even though the provider didn't load data.

New behavior

Starting in .NET 11, FileConfigurationProvider doesn't call OnReload after Load fails and the OnLoadException callback sets Ignore to true. The reload token doesn't fire because the provider didn't load data.

Type of breaking change

This change is a behavioral change.

Reason for change

To avoid a notification when no data changes, FileConfigurationProvider calls OnReload only after it loads data. This behavior resulted from a control-flow fix in dotnet/runtime#126093.

Don't depend on the reload token when the provider doesn't load data. If your application must run code after an ignored load failure, call that code from your OnLoadException callback.

Affected APIs