overload several config files?

  • Thread starter Thread starter lobrys
  • Start date Start date
L

lobrys

Hi

I am building a dotnet 1.1 app, in VB.net ...

I would like to have several config files corresponding to multiple
envirronment (Database, local Machine, Application, User...) and overloads
each, in order to have, by the way, one config.

So I would like to load a config file (app.config) at startup (as usual),
then overload this file with a new file (came from SQL for exemple), then
overload with a second file.....etc....

What do you think about that? is it possible?

Do i must access to each file manually (with xml methods) ? read them and
then construct one config file, and then load it?


Thanks!!!!!!
bye
syl
 
Hi,

I have tried and successfully loaded diffrent config files based on diffrent
business condition. Don't know it is the optimised solution:

Here is the code in C#

System.Configuration.ConfigXmlDocument doc = new
System.Configuration.ConfigXmlDocument();
doc.Load ("app.config");

I would convert the same in vb.net for you:

Dim doc as new System.Configuration.ConfigXmlDocument()
doc.load(app.config)

Then you have to access each node and attribute manually.

Best Regards,

Piyush Thakuria
 
Hello

Thanks for your response Piyush!

I dont understand your answer.....
OK for reading file, but attribute manually to what?

Thanks
bye!
syl
 
We do something similar via a dll that runs as a step in our install
packages.

We create a set of configuration files (Dev, Test, QA, Production, etc.) and
then add a extra dialog to the installer that allows the User / Install to
pick the environment to which the application is being installed. Based upon
their selection, a conditional variable is set that the dll (which is invoked
as a Custom Action) uses to replace the Web.Config file in the project with
the particular <Environment.config> file.

So far it works great for us to be able to deliver a single install package
that can install our application to multiple environments based upon which
one the User / Installer selects from that additional dialog box (added via
Add Dialog).

SwamiDave
 
Back
Top