473,396 Members | 1,590 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,396 software developers and data experts.

Handling of App.config Files in Solution with some Subprojects

Hi all.
I'd like to get deeper into details of project layout in visual studio. And
maybee someone finds it interesting ...
I've got a project with the following layout just theoretical:

Solution:
- Project Network (DLL) with app.config (some links to Webservices and so
on)
- Project Database (DLL) with app.config (ConnectionStrings and so on)
- Project TestExecutable(Exe) with app.config (some Logging entries or so)

When I build that solution I get just on config file in the bin/Debug
folder: "TestExecutable.Exe.config"

The settings in the other files are compiled into the DLLs and thanks to
Lutz Roeder I can find it there in the CompilerGenerated internal sealed
class Settings.
Hmmm, so far so good, but ...
When I like to change that value I have to open the sources, change the
value and rebuild and distribute it.
I made a config file for easy changeing that values ...
Of course a simple workaround would be to put all admin stuff in the
settings file of the Exe and tell every Dll in Constructor their settings.

But I'd like to know whether there's a possibility to do that in a way I got
one .config file per project on filesystem in bin/DEBUG instead of built
into dll?

Maybee someone finds this interesting ...

Bye Barney Gumble

Aug 22 '08 #1
1 1485
In my experience, config files are useless if they are compiled into your
DLL. they can't be read from there. What I do is to use the app.config in the
library projects as a sample configuration, or to document the defaults.
(note that SETTINGS classes do store their defaults in the library resources,
but not in an embedded config file)

Your EXE project will need its own copy of all the child project
configurations. There's no nice way for VS to merge/update the child
configurations. And even if there were, it would piss off a lot of people and
prevent easy code reuse in a lot of situations where different projects need
to override the library configuration in some manner. (It would be nice to
have some sort of VS add-in to help with this)

--
Eric Falsken
Technical Evangelist: db4o
http://www.db4o.com

Aug 22 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Hans-Joachim Widmaier | last post by:
Hi all. Handling files is an extremely frequent task in programming, so most programming languages have an abstraction of the basic files offered by the underlying operating system. This is...
13
by: gaudetteje | last post by:
Hi All, I've been trying to come up with an elegant solution to this problem, but can't seem to think of anything better than my solution below. I have a Python program that needs to be...
0
by: Kamal Dhingra | last post by:
Hi Guys, I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
3
by: Simon | last post by:
Hi everyone, I really need help with the following: It's common in app development to create numerous projects under one solution that as a whole combine to become your final application. For...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
5
by: BPearson | last post by:
Hello I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to...
1
by: Ivan | last post by:
Hi, I have moved an entire solution from .netframework 1.0 to 1.1; also I have migrated the solution to VS2003. After this I have added a new project (Web) to previous solution; I'm referencing...
0
by: Kamal Dhingra | last post by:
Hi Guys, I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
3
by: Mr Newbie | last post by:
I'm testing error handling configurations and having some trouble. I created a WebForm called. ErrDefault.aspx and I am trying to use the Page error attribute to force the redirection to a custom...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.