0

I used solution from this topic How to have custom nested configuration App.Config nodes and section. But I need a possibility to change values in custom section's properties from code. Now I have "System.Configuration.ConfigurationErrorsException: 'The configuration is read only.'" error on setter of properties like this

    [ConfigurationProperty("ChartName", IsRequired = true)]
    public string ChartName
    {
        get => (string)this[nameof(ChartName)];
        set => this[nameof(ChartName)] = value;
    }
2
  • If you want to do some kind of fancy configuration, have you considered storing a json file in your appdata folder? That should give you a fairly simple way to store arbitrary object hierarchies. Commented Apr 4, 2024 at 8:32
  • Yes. But I am already used standard Settings.settings and looks like for another settings are better to add them is the same place. But if I won't find solution I will use another config file Commented Apr 4, 2024 at 10:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.