2
2G
Hi,
I have some trouble reading from the config file, don't know what I'm doing
wrong.
I created a config file named App.config and contains following :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Port" value="20789" />;
</appSettings>
</configuration>
but when i try to get the port from the app config using
string tmp = System.Configuration.ConfigurationSettings.AppSettings["Port"];
i get error "Only elements allowed".
Anyone could help me out a bit ?
Thanks.
I have some trouble reading from the config file, don't know what I'm doing
wrong.
I created a config file named App.config and contains following :
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Port" value="20789" />;
</appSettings>
</configuration>
but when i try to get the port from the app config using
string tmp = System.Configuration.ConfigurationSettings.AppSettings["Port"];
i get error "Only elements allowed".
Anyone could help me out a bit ?
Thanks.