471,339 Members | 1,415 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,339 software developers and data experts.

overload several config files?

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


Jul 21 '05 #1
3 2183
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
"lobrys" wrote:
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


Jul 21 '05 #2
Hello

Thanks for your response Piyush!

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

Thanks
bye!
syl


"Piyush Thakuria" <pi*************@wipro.com.donotspam> a écrit dans le
message de news: 7B**********************************@microsoft.com...
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
"lobrys" wrote:
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


Jul 21 '05 #3
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

"lobrys" wrote:
Hello

Thanks for your response Piyush!

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

Thanks
bye!
syl


"Piyush Thakuria" <pi*************@wipro.com.donotspam> a écrit dans le
message de news: 7B**********************************@microsoft.com...
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
"lobrys" wrote:
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



Jul 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Chiller | last post: by
22 posts views Thread by Daniel Billingsley | last post: by
3 posts views Thread by lobrys | last post: by
6 posts views Thread by Jonas Huckestein | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.