Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Handling of App.config Files in Solution with some Subprojects

Reply
 
Old 08-22-2008   #1 (permalink)
Barney Gumble


 
 

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


My System SpecsSystem Spec
Old 08-22-2008   #2 (permalink)
Eric Falsken


 
 

RE: Handling of App.config Files in Solution with some Subprojects

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

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Re: Handling Large Numbers of Files PowerShell
Handling DBX Files .NET General
Solution: Config Error when conne Xbox360 to Media Center Vista Vista General
Re-Enabling Vista's native handling of ZIP files??? Vista General
TRYING to use XML Config files PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46