473,394 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

app.config file not read?

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
2 1903
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a...
4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
16
by: DraguVaso | last post by:
Hi, I have a Windows Service running (made in VB.NET), and wanted to be able to change from time to time some parameters by changing them in the App.config. But it seems that the application...
3
by: Mustaq | last post by:
Hi, How to read same config file from different application? I have 4 application in VB.NET, all are using different app.config files. NOW I need all to read only one config file, how can I do...
4
by: TomB | last post by:
I've written a simple service that reads the app.config file on start. It works fine if I start it from the VS IDE -- F5 then installutil I then created a package, wherein the content of...
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
5
by: Sridhar | last post by:
Hi, I have created a project which contains classes to read the data from the database. This project has an App.Config file which contains the SqlConnection String. when this code is called from...
3
by: Richard Lewis Haggard | last post by:
I have a test application that is calling an assembly that reads some strings out of a config file. Normally, this assembly supports a web application and the information can be read just fine....
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
12
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.