M
MrFile
I added an app.config file to my application. (c#.net component dll)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="username" value="xx" />
<add key="password" value="xx" />
</appSettings>
</configuration>
I then try to read it in my code as:
_username = ConfigurationSettings.AppSettings["username"].ToString();
The only using reference i have is using System; and
System.Configuration;
I get an error when trying to read it saying the value is null.
(running my application in debug mode. This component is being called
by an ASP.NET application also running in debug under the same
session)
What am i doing wrong here? Iv read a lot of forums and searched all
over google but ims till very confused.
Should i do anything with the app.config file? Do i have to name it
something else or move it into the bin folders?
Any help would be appreciated.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="username" value="xx" />
<add key="password" value="xx" />
</appSettings>
</configuration>
I then try to read it in my code as:
_username = ConfigurationSettings.AppSettings["username"].ToString();
The only using reference i have is using System; and
System.Configuration;
I get an error when trying to read it saying the value is null.
(running my application in debug mode. This component is being called
by an ASP.NET application also running in debug under the same
session)
What am i doing wrong here? Iv read a lot of forums and searched all
over google but ims till very confused.
Should i do anything with the app.config file? Do i have to name it
something else or move it into the bin folders?
Any help would be appreciated.