Westwind.ApplicationConfiguration icon indicating copy to clipboard operation
Westwind.ApplicationConfiguration copied to clipboard

JsonFileConfigurationProvider Doesn't Save Multiple ConfigurationSections

Open vector-man opened this issue 10 years ago • 1 comments
trafficstars

When working with multiple configuration classes that have different ConfigurationSection names and save to the same JSON file, ConfigurationSection does not work. Instead, only the most recent object Write is saved to the file.

Example (all saving to Settings.json"): colors.Write() // Has ConfigurationSection defined as "Colors" under OnCreateDefaultProvider users.Write() // Has ConfigurationSection defined as "Users" under OnCreateDefaultProvider

Only users are saved, and without any ConfigurationSection too.

Using another provider seems to work fine.

vector-man avatar Mar 11 '15 06:03 vector-man

Sorry for not responding sooner.

Not sure I understand. The JSON provider works with individual files for each configuration you create. JSON and XML configuration doesn't have a concept of sections. You just create your objects and they are persisted to disk as files using standard serialization.

RickStrahl avatar Jul 27 '15 05:07 RickStrahl