NoCoolHandle
Programmer
Hi..
I am playing with application settings. Specificly the ones you get to by selecting the properties of the project, going to the settings tab and adding a key.
When I do this, it creates a file using the following syntax
projectname.exe.config
In a winforms app I could read it using
Properties.Settings.Default.PropertyName
This doesn't exist in a console app. Instead you are supposed to use
ConfigurationSettings.AppSettings["PropertyName"]
However this returns null and checking the count of AppSettings returns 0
I have placed the config file in all the debug directorys
No luck getting the value.
any clues appreciated.
Rob
PS Inside of the file looks like.
I am playing with application settings. Specificly the ones you get to by selecting the properties of the project, going to the settings tab and adding a key.
When I do this, it creates a file using the following syntax
projectname.exe.config
In a winforms app I could read it using
Properties.Settings.Default.PropertyName
This doesn't exist in a console app. Instead you are supposed to use
ConfigurationSettings.AppSettings["PropertyName"]
However this returns null and checking the count of AppSettings returns 0
I have placed the config file in all the debug directorys
No luck getting the value.
any clues appreciated.
Rob
PS Inside of the file looks like.
Code:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ConsoleReadSettings.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<ConsoleReadSettings.Properties.Settings>
<setting name="RobSetting" serializeAs="String">
<value>This is the test setting</value>
</setting>
</ConsoleReadSettings.Properties.Settings>
</applicationSettings>
</configuration>