Configuration

P

Paul Ledger

I've written a control and I want to be able to pass certain information to
it via a configuration file. I've created the config using the namespace +
dll + config and I've placed it in the bin directory on the website. But when
it comes to reading the information from the file using...

string repositoryClass =
ConfigurationSettings.AppSettings.Get("ICacheRepositoryClass");

I always get null as the value

Is there anyway of finding exactly where .NET looks for the file?

Hope someone can help
 
J

Josue Camargo Cruz

Paul Ledger said:
I've written a control and I want to be able to pass certain information to
it via a configuration file. I've created the config using the namespace +
dll + config and I've placed it in the bin directory on the website. But when
it comes to reading the information from the file using...

string repositoryClass =
ConfigurationSettings.AppSettings.Get("ICacheRepositoryClass");

I always get null as the value

Is there anyway of finding exactly where .NET looks for the file?

Hope someone can help

Hi Paul, the problem is that the ConfigurationsSettings.AppSetings
reads from the file "AppName.exe.config" or "Web.config" (depending if
it's a winforms or web project). The configuration file you are
searching for is not on the bin directory, but outside, with the asmx
files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top