Where does Settings.Default.MySetting come from?
-
Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?
-
Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?
The default value is hard coded as an attribute on the property. Look in the Settings.Designer.cs file for the "DefaultSettingValueAttribute" attribute on each property. Note that "user" scope settings can also be stored in a config file in the documents and settings/username/localsettings/application data folder.
Simon
-
Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?
I beleive the info is stored in the appconfig file. So when you right click your application in the explorer window and select properties, the settings tab allows you to store information in the app config table.
Never underestimate the power of human stupidity RAH
-
The default value is hard coded as an attribute on the property. Look in the Settings.Designer.cs file for the "DefaultSettingValueAttribute" attribute on each property. Note that "user" scope settings can also be stored in a config file in the documents and settings/username/localsettings/application data folder.
Simon
Simon Stevens wrote:
The default value is hard coded as an attribute on the property
Thanks, that's what I've been looking for.