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 / March 2006

Tip: Looking for answers? Try searching our database.

console app with multiple configuration files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MarkAurit - 03 Mar 2006 15:59 GMT
I have an app I run under the windows scheduler that makes use of the .config
file, and I use Configuration.AppSettings to interrogate it.  I would like to
run it against more than 1 .config file, and the only way I can think to do
this (using Configuration.Appsettings) is to create a copy of the app on the
filesystem for each .config file.  Obviously, not very elegant, but I dont
have the time to play with XML.  Is it possible to do something like pass the
config file name in on the command line?  Or does someone know of a cleaner
solution?
This using 1.1
Thanks, Mark
Kevin Spencer - 03 Mar 2006 17:26 GMT
You'll either have to "play with XML," create your own custom config files
(in whatever format you like), use the System Registry, or use the .Net
Configuration model. Have you considered that you can host multiple
configurations in a single Configuration file, using custome Configuration
Sections? IOW, what makes you so sure you have to use multiple files?

The good news is, you have a lot of options!
Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer

Presuming that God is "only an idea" -
Ideas exist.
Therefore, God exists.

>I have an app I run under the windows scheduler that makes use of the
>.config
[quoted text clipped - 12 lines]
> This using 1.1
> Thanks, Mark
Steve B. - 03 Mar 2006 17:28 GMT
Create a DataSet qwith two columns key and value

Use the WriteXml and ReadXml features of the dataset to build/read the
config files, and DataTable.FindByKey() method it will generate to retrieve
a value...

Steve

>I have an app I run under the windows scheduler that makes use of the
>.config
[quoted text clipped - 12 lines]
> This using 1.1
> Thanks, Mark

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.