For my project I have settings that I added through the Settings in the project properties.
I quickly discovered that editing the app.config file directly seems to no really update the settings value. Seems I have to view the project properties when I make a change and then recompile.
I'm wondering ... what is the best and easiest way to handle customizable settings for a project -- thought this would be a no-brainer with how .Net handles it ... shame on me.
Is it possible to use one of the settings, AppSettings, ApplicationSettings, or UserSettings to handle this?
Is it better to just write my settings to custom config file and handle things myself?
Right now ... I am looking for the quickest solution!
My environment is C#, .Net 3.5 and Visual Studio 2008.
Update
I am trying to do the following:
protected override void Save()
{
Properties.Settings.Default.EmailDisplayName = this.ddEmailDisplayName.Text;
Properties.Settings.Default.Save();
}
Gives me a read-only error when I compile.
config, contains settings that apply to an entire computer. This file is located in the %runtime install path%\Config directory.
We will start with creating an class that can store the instance settings (the <add> element), then we'll create a collection that can store our instances (the <instances> element) and then we'll create the class to manage the Configuration Section (the <sageCRM> element).
An application configuration file is an XML file used to control assembly binding. It can redirect an application from using one version of a side-by-side assembly to another version of the same assembly. This is called per-application configuration.
This is silly ... and I think I am going to have to apologize for wasting everyone's time! But it looks like I just need to set the scope to User instead of Application and I can the write the new value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With