Settings in VS 2005 C#
-
Per usual it has to be as confusing as possible when it comes to C#. Something simple in VB like My.Settings.name becomes appnamespace.Properties.Settings.Default.name. This isn't really that bad except that the word Default is associated with both User and Application settings. The first time Settings.Default.Save() is executed, which by the way can only affect User settings, my definition of the word default goes out the window. Even though there are lines of code buried in the designer which contain System.Configuration.DefaultSettingValueAttribute, the values associatied with them have nothing to do with the values returned by Settings.Default following a save. For reasons I have yet been unable to fathom the initial value for all settings is stored both in the designer code and the app.config file. The next thing I should do is change the app.config file manually and see which "default" value is actually returned. No real question this time. Just needed to vent a bit... >>>-----> MikeO
-
Per usual it has to be as confusing as possible when it comes to C#. Something simple in VB like My.Settings.name becomes appnamespace.Properties.Settings.Default.name. This isn't really that bad except that the word Default is associated with both User and Application settings. The first time Settings.Default.Save() is executed, which by the way can only affect User settings, my definition of the word default goes out the window. Even though there are lines of code buried in the designer which contain System.Configuration.DefaultSettingValueAttribute, the values associatied with them have nothing to do with the values returned by Settings.Default following a save. For reasons I have yet been unable to fathom the initial value for all settings is stored both in the designer code and the app.config file. The next thing I should do is change the app.config file manually and see which "default" value is actually returned. No real question this time. Just needed to vent a bit... >>>-----> MikeO
:confused:
-
:confused:
I have an engineering rather than a software background, so maybe a word like default has a different meaning for me than it does for a real programmer. I modified a value in the app.config file and ran the debugger. The value used by the program was the value in the app.config file. Later, when I looked at the Settings.settings designer, it identified the mismatch. Apparently the value in the Setttings.Designer.cs is used only by the designer. Some of this is making more sense except for the use of Default in the namespace. >>>-----> MikeO -- modified at 13:54 Wednesday 5th July, 2006