How to use a shared app.config file?

G

Guest

..Net 2.0 I have a variety of console applications that run continuiously in
parallel using the file watcher as an event queue. In addition, I have an
ASP.Net website that needs to access the same key/value pairs as the console
apps. I have configured a separate app.config file for each console app and
have a separate web.config file for the web site. To simplify the
configuration, I would like to use a single app.config file that can be
accessed by each application. Is there a simple way to do this?

Thanks,
 
C

Chris Mullins [MVP - C#]

A few things come to mind, none of which are probably what you're looking
for:

- Put the relevent entries in the machine.config. This way everything can
see them. This would be very, very easy.

- From your main entry point, create a new appdomain and set it's config
file to be the shared config file. Set the entry point to be the relevant
code, and let your code start running.

- Store the data in a database, and read it from each app.

- Store the data in an XML file somewhere, and just have each app open the
file and read the values out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top