Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

overload several config files?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
lobrys - 06 May 2005 16:22 GMT
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
Piyush Thakuria - 09 May 2005 11:00 GMT
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

> Hi
>
[quoted text clipped - 16 lines]
> bye
> syl
lobrys - 09 May 2005 13:46 GMT
Hello

Thanks for your response Piyush!

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

Thanks
bye!
syl

> Hi,
>
[quoted text clipped - 40 lines]
>> bye
>> syl
SwamiDave - 10 May 2005 13:41 GMT
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

> Hello
>
[quoted text clipped - 51 lines]
> >> bye
> >> syl

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.