Closed LyndonGingerich closed 3 months ago
This is on WestWind.Utilities 3.0.22.
Upgrading to WestWind.Utilities 5.0.8 does not change the behavior.
This is interesting:
/// <summary>
/// Override this method to use a specialized configuration provider for your config class
/// when no explicit provider is passed to the Initialize() method.
/// </summary>
/// <param name="sectionName">Optional section name that was passed to Initialize()</param>
/// <param name="configData">Optional config data that was passed to Initialize()</param>
/// <returns>Instance of configuration provider</returns>
protected virtual IConfigurationProvider OnCreateDefaultProvider(string sectionName, object configData)
{
// dynamically construct the generic provider type
#if NETFRAMEWORK
var providerType = typeof(ConfigurationFileConfigurationProvider<>);
#else
var providerType = typeof(JsonFileConfigurationProvider<>);
#endif
var type = GetType();
Type typeProvider = providerType.MakeGenericType(type);
var provider = Activator.CreateInstance(typeProvider) as IConfigurationProvider;
// if no section name is passed it goes into standard appSettings
if (!string.IsNullOrEmpty(sectionName))
provider.ConfigurationSection = sectionName;
return provider;
}
Maybe the issue is the move from ConfigurationFileConfigurationProvider
to JsonFileConfigurationProvider
?
Hmm. There appears to be some curious use of System.Configuration.NameValueSectionHandler
. Maybe that is causing issues.
The old .NET XML provider doesn't work under .NET Core so you have to switch to a different provider - the default provider for .NET Core is the JsonFile provider.
All right, I'll migrate. Could we document this? The current documentation seems to be written exclusively for .NET Framework.
I am upgrading a project using
AppConfiguration
from .NET Framework 4.7.2 to .NET 8.0. After the upgrade, I get this pop-up: And the app fails to run.Using the decompiler, I found that my
AppConfiguration
type is being loaded fromapplicationConfiguration.json
. I store my settings inapp.config
.applicationConfiguration.json
has most of the same field names, but all the booleans are set tofalse
and the strings tonull
. And so my app, which is expecting configuration to be loaded from XML with""
as the default value for strings instead ofnull
, throws an exception.What has changed? How should I update my code? I didn't see releases on this repository or release notes on the tags or anything.