By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,150 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,150 IT Pros & Developers. It's quick & easy.

Web.config and app.config issues

P: n/a
I have a question about config files. I have the following in my

1. ASP.NET web application with a web.config
2. C# class library (BL and DAL) with an App.config
3. Two windows Console Applications with their own App.Config.

Now I try to retrieve a value in the DAL using this code.

string str = ConfigurationSettings.AppSettings.Get("Value");

This code works fine when the windows applications are running. But
when the Webapplication is running and invokes an method in the Data
Access layer, the piece of code tries to refer to the Web.Config
instead of its own app.config even though it is in the DAL. Is there
any code that will tell DAL to refer to its own config file?

Can anyone tell me if I can do what i trying to do and if yes what
changes do I need to make to my code for it to work?.
I do need the app.config at the DAL level as there are some settings
common to both the windows as well as web application and that is the
best place to put it.
Help Please,
Thanks Kalyan

Apr 4 '06 #1
Share this Question
Share on Google+
1 Reply

P: n/a

2. C# class library (BL and DAL) with an App.config

a DLL cannot have a config file, or at least the framework does not provide
for it. You will have to implement it on your own

Ignacio Machin,
ignacio.machin AT
Florida Department Of Transportation
Apr 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.