Open gavynriebau opened 8 years ago
Interesting - I'd not really considered this scenario.
You're right, I think this counts as a bug just due to it violating the principal of least surprise - you'd expect save to work, and it doesn't.
I'm not entirely sure if it's possible / if there's even an event to hook into when regular ol' configuration manager calls "Save" though.
I'll take a look into this and see if there's something I can do.
When using a mix of the .NET
System.Configuration.ConfigurationManager
andSystem.Configuration.Abstractions.ConfigurationManager
to retrieve and update appSettings, the returned results aren't consistent.Here are the full steps to reproduce the problem:
Setup an App.config that contains:
Create a
System.Configuration.Abstractions.ConfigurationManager
instance and load the app setting:Now use a .NET
System.Configuration.ConfigurationManager
to update the value.Then try to refresh the section and retrieve the update value using the
System.Configuration.Abstractions.ConfigurationManager
.The above code should have returned the updated value "B" but returns the original value "A". I've run the above scenario and confirmed the value in App.config file does get updated but I suspect the
System.Configuration.Abstractions.ConfigurationManager
is using a memory backed cache of app settings.I'm not sure of the correct solution to this bug other than possible not mixing usage of
System.Configuration.Abstractions.ConfigurationManager
and the .NETSystem.Configuration.ConfigurationManager