I was trying to learn how to add and use User settings and Application settings.
And somehow I've managed to create some kind of double setting.
Here is my app.config file.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a6c561934e089" >
<section name="TestApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a6c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<userSettings>
<TestApp.Properties.Settings>
<setting name="CsvPath" serializeAs="String">
<value>value</value>
</setting>
<setting name="Sweet" serializeAs="String">
<value>sugar</value>
</setting>
</TestApp.Properties.Settings>
</userSettings>
</configuration>
In my code I have this.
Properties.Settings settings = new Properties.Settings();
string s = settings.CsvPath;
if (!String.IsNullOrEmpty(s))
{
MessageBox.Show(settings.CsvPath);
}
else
{
MessageBox.Show("Not Set");
}
I would expect my message box to show "value" but it shows "OK" which is a setting I tried earlier, which I thought was gone.
Forgotten how to post an image.
http://s8.postimg.org/7mbu6nrsl/settings.jpg
Almost forgot my question.
What on earth is going on here?
(edit)
It's quite possible that earlier I had application setting as CsvPath, but it's not showing in xml.