473,834 Members | 2,255 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 (ConnectionStri ngs 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 CompilerGenerat ed 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 1499
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
3212
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 indeed also true for our language of choice, Python. Its file type allows some extraordinary convenient access like: for line in open("blah"): handle_line(line)
13
1545
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 converted into an executable. The problem is that I have a "config" template file that I've been using to modify initialization constants such as paths, global variables, structures, etc. Obviously, once I convert my code into an executable I can no...
0
1479
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 problem is i want 2 different custom error handling files ,one for the main site and other for the admin.In the config file in admin I wrote <customErrors defaultRedirect="CustomErrorAdmin.aspx" mode="On" /> and in the other config file i wrote ...
3
1820
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 example I have a solution that has four subprojects - 3 class libraries and 1 windows forms app. Q - Some of these projects - both class library and win form application
22
3023
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 files, which in turn could be simply and easily maintained with notepad. I understand the benefits of XML, really, but in the case of configuration files it seems it is almost always nothing more than unnecessary complexity, both in accessing them...
5
10539
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 do this? (IIS 5 or 6 In case you're wondering why I would do this, we have many web sites on a single server, and there are groups of sites that need to share common configuration information. I'd like to ease some administration by having one...
1
5696
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 a DLL from other project within the solution and including some user controls within my new project, but whenever I try to execute a new aspx I have coded I receive next error message (see below); the problem is that some times the Parser Error...
0
1311
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 problem is i want 2 different custom error handling files ,one for the main site and other for the admin.In the config file in admin I wrote <customErrors defaultRedirect="CustomErrorAdmin.aspx" mode="On" /> and in the other config file i wrote ...
3
2063
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 page, but I only get and unhandled exception page and it does not direct me to my specific page. I'm probably doing something really stupid, but I cant see what . Any Ideas ? - Thanx Mr N --------- DETAILS BELOW -----------
0
9796
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9642
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10543
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9323
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.