Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Recommended action
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
- Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
- Microsoft.Extensions.Configuration.Ini.IniConfigurationProvider.Load(Stream)
- Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider.Load(Stream)
- Microsoft.Extensions.Configuration.Xml.XmlConfigurationProvider.Load(Stream)