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

app.config file not read?

P: n/a
I'm having trouble getting the settings out of my app.config file in a c#
project. I have put the file in the root of the project and in the bin
output directory with the name "app.config" and "<dllname>.dll.config" with
no luck. Every time I try to read from the config file I get the following
error:

"The key 'systemName' does not exist in the appSettings configuration
section."

where "systemName" is the first setting in the appsettings section. Any
ideas what I'm doing wrong, or what setting I managed to bork?

Thanks for any advise,
scott.
Nov 15 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I don't think app.config is designed to work with DLLs like that.
Instead name the app.config after the executable that utilizes the DLL,
and the DLL should then be able to pick up the configuration from there.

"Scott Graupmann" <sg********@convera.com> wrote in message
news:uf****************@TK2MSFTNGP11.phx.gbl...
I'm having trouble getting the settings out of my app.config file in a c#
project. I have put the file in the root of the project and in the bin
output directory with the name "app.config" and "<dllname>.dll.config" with no luck. Every time I try to read from the config file I get the following
error:

"The key 'systemName' does not exist in the appSettings configuration
section."

where "systemName" is the first setting in the appsettings section. Any
ideas what I'm doing wrong, or what setting I managed to bork?

Thanks for any advise,
scott.

Nov 15 '05 #2

P: n/a
Thanks for the quick reply. As it happens I just figured out what was going
on. I'm using NUnit to test a Class Library and it has a setting I did not
know about that loads a file. Patched up the default value to one that
matched the .config file name and all is groovy now... at least until I
break something new... :)

Thanks,
scott.
"pesso" <pe***@no.where> wrote in message
news:40********@news.microsoft.com...
I don't think app.config is designed to work with DLLs like that.
Instead name the app.config after the executable that utilizes the DLL,
and the DLL should then be able to pick up the configuration from there.

"Scott Graupmann" <sg********@convera.com> wrote in message
news:uf****************@TK2MSFTNGP11.phx.gbl...
I'm having trouble getting the settings out of my app.config file in a c# project. I have put the file in the root of the project and in the bin
output directory with the name "app.config" and "<dllname>.dll.config"

with
no luck. Every time I try to read from the config file I get the following error:

"The key 'systemName' does not exist in the appSettings configuration
section."

where "systemName" is the first setting in the appsettings section. Any
ideas what I'm doing wrong, or what setting I managed to bork?

Thanks for any advise,
scott.


Nov 15 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.