C
comic_rage
Hi,
I am trying to read from my application config file and keep getting
null.
Here is my config file
My application is called SampleApp.exe
I named the config file: SampleApp.exe.config
Inside the config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="key1" value = "test1"/>
</appSettings>
</configuration>
In my C# code, I have the following
string strTest1 =
System.Configuration.ConfigurationSettings.AppSettings["key1"];
I keep getting null value for strTest1.
I tried placing the SampleApp.exe.config inside the debug bin folder. I
also tried creating a shortcut of the config and placing that shortcut
inside the bin/debug folder, but the same results.
Any help is appreciated.
Thanks,
Rage
I am trying to read from my application config file and keep getting
null.
Here is my config file
My application is called SampleApp.exe
I named the config file: SampleApp.exe.config
Inside the config file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="key1" value = "test1"/>
</appSettings>
</configuration>
In my C# code, I have the following
string strTest1 =
System.Configuration.ConfigurationSettings.AppSettings["key1"];
I keep getting null value for strTest1.
I tried placing the SampleApp.exe.config inside the debug bin folder. I
also tried creating a shortcut of the config and placing that shortcut
inside the bin/debug folder, but the same results.
Any help is appreciated.
Thanks,
Rage