Sharing configuration between multiple .net projects

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everyone,

I was wondering whether there is a possibility how to most easily share one configuration between multiplne projects in one solution. Let me explain my situation - I'm building small customer portal for Wi-Fi internet provider. Basically, I have 3 different applications (ordinary ASP.NET web site, adminstration site and one console app, that will be responsible for processing of incoming emails) that will all use the same information (current VAT rate and some other solution related numbers). At this moment, I store these information in .config files, which is not very convenient in case of change. Also, I don't want to store this in database. I would like to see something like solution.config that shoud be shared thru whole solution. Is something like this possible.

Thanks in advance,

Antoni
 
Mr. Jelinek
The way I see it you have a couple of options. You could put your config file in your solutions folder of your solution and then use the Post-build Event command line to copy the solution file to each of your projects output directories or you could build a custom config project that loads the config file from one given location. The problem with this solution is that the config file for a dll doesn't get copied over the other solutions build directory automatically like the dll does. I would suggest doing the former. With the latter you could put a config entry in each projects config file that tells your custom config loader dll where the config file resides. This is messy though. Or, thinking about it there is a way to do a config file include from each projects config file and just point that to where the config file will be stored. The one advantage of the custom config file handler dll that I see is that you can monitor the config file for changes and reload it when it changes which would allow you to change your configuration on the fly without shutting down your applications

But the easiest is probably the first scenerio that I gave

Hope this gives you some direction

John Sheppar
Missouri Botanical Garde

----- Antonin Jelinek wrote: ----

Hi everyone,

I was wondering whether there is a possibility how to most easily share one configuration between multiplne projects in one solution. Let me explain my situation - I'm building small customer portal for Wi-Fi internet provider. Basically, I have 3 different applications (ordinary ASP.NET web site, adminstration site and one console app, that will be responsible for processing of incoming emails) that will all use the same information (current VAT rate and some other solution related numbers). At this moment, I store these information in .config files, which is not very convenient in case of change. Also, I don't want to store this in database. I would like to see something like solution.config that shoud be shared thru whole solution. Is something like this possible.

Thanks in advance,

Antoni
 
Back
Top