views:

28

answers:

2

I have a project that I am breaking up into multiple .exe projects. I still plan on publishing them, using click once, into the same location at the same time, and I would like to use the same config file.

I have added the app.config to each project using the "Add link" option in Visual Studio, which is great for debugging, but in production, when I compile each exe project, the app.config is not copied into the "master project"'s bin folder.

example:

master.exe with master.exe.config

master.exe may launch order.exe based on user settings master.exe may launch returns.exe based on user settings

master, order, and returns will all reside in the same folder, and should share a single config file.

+1  A: 

I'd suggest that if you want to do this it might be better to just read/write to the config file via the normal XML classes.

ho1
A: 

You can't, not with the default CLR host. You could write a custom host that uses a different AppDomainSetup.ConfigurationFile to initialize the primary AppDomain. But you'd surely don't want that pursue that, C++ and COM skillz required.

Using a lot of EXEs is pretty unusual. Most anything a EXE can do, a Thread can do as well. Other than preventing the main app from going down when it crashes with an unhandled exception. Stuffing the config in a separate xml file is probably the quickest solution.

Hans Passant
Thats what I figured, but I wanted to ask to be sure. Sometimes there are hidden gems that I'm not aware of.Thanks
Russ