CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 11/5/2007 4:49:33 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 4 Views: 61 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
5 Items, 1 Pages 1 |< << Go >> >|
togakangaroo
Asp.Net User
how to overwrite config files (Console app, not ASP)11/5/2007 4:49:33 PM

0/0

Hello, I have a console application that is configured through the app.config file, I am looking for a way that I can use a different file - let's say override.config - where all configuration settings with the name in override.config will override their corresponding values in app.config. So what I'm trying to do is similar to what happens with machine.config/web.config.

app.config:
<add key="key1" value="10" />
<add key="key2" value="hi there" />
override.config:
<add key="key2" value="overriden string" />

I would like this to result in the configuration
ConfigurationSettings.ApplicationSettings["key1"] == 10
ConfigurationSettings.ApplicationSettings["key2"] == "overriden string"
Does anyone know a simple way I can do this without having to parse an xml file myself? Is there anything built into .net?
Thanks a lot,
toga
togakangaroo
Asp.Net User
Re: how to overwrite config files (Console app, not ASP)11/5/2007 6:27:57 PM

0/0

While I was posting initially in the configuration forum, I am afraid this has gotten moved to the wrong one. I am working in .NET 1.1/vs2003, so, while I am curious as to how this would be achieved in vs2005 as I will evnetually be transferring my application over to ASP 2.0, this is in no way a visual studio 2005 (or really even a visual studio) question since currently I need a solution that would work with .NET 1.1 no matter the IDE I use
jguadagno
Asp.Net User
Re: how to overwrite config files (Console app, not ASP)11/5/2007 6:36:37 PM

0/0

You will have to create your own configuration class to handle this.  First you would load the values from the app.config, then load the values from override.config. 


Joseph Guadagno
My Website: http://www.josephguadagno.net
My Blog - http://weblogs.asp.net/jguadagno/

If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
togakangaroo
Asp.Net User
Re: how to overwrite config files (Console app, not ASP)11/5/2007 6:54:59 PM

0/0

ok, so you're talking about actually having to manually read in the override file with the XPathReader class?
does anyone know off the top of their heads the xpath to pull out an array of all the objects in the app.config file. Even better, does anyone know a website where I can play with xpath expressions? I'm not that great at them yet
jguadagno
Asp.Net User
Re: how to overwrite config files (Console app, not ASP)11/5/2007 7:09:32 PM

0/0

You can get XpathMania  (http://donxml.com/allthingstechie/archive/2006/07/07/2792.aspx) a free Visual Studio add-in for querying XPaths.


Joseph Guadagno
My Website: http://www.josephguadagno.net
My Blog - http://weblogs.asp.net/jguadagno/

If this has helped Please: Don't forget to click "Mark as Answer" on the post that helped you.
That way future readers will know which post solved your issue.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Applied XML Programming for Microsoft .NET Authors: Dino Esposito, Pages: 696, Published: 2002
Building Client/server Applications with VB .NET: An Example-Driven Approach Authors: Jeff Levinson, Pages: 597, Published: 2003
Coder to Developer: Tools and Strategies for Delivering Your Software Authors: Mike Gunderloy, Pages: 297, Published: 2004
Building Profitable Solutions with Microsoft Backoffice Small Business Server 4.5: With Microsoft BackOffice Small Business Server 4.5 Authors: Joshua Feinberg, Pages: 640, Published: 1999
Windows 2000 Clustering and Load Balancing Handbook Authors: Joseph Lamb, Pages: 432, Published: 2002
Essential SharePoint 2007: A Practical Guide for Users, Administrators and Developers Authors: Jeff Webb, Pages: 428, Published: 2007

Web:
Inside Microsoft: Updating the ASP.NET Cache Based on Data in a ... NET console application. The ASP.NET page places the XML files that need to .... After that we retrieve the path of the XML file from the app.config file. ...
Tips to Handle Config files for Testing and Deployment [timstall ... Two common config files are:. Web.Config - used by an ASP.Net or Web Service project. App.Config - used by executables like console apps or Windows Forms. ...
CodeProject: Config Customization at Build Time in Visual Studio ... Jun 22, 2008 ... The ConfigMerge.exe console application is also pretty straightforward. ... For ASP.NET or WCF applications that use a web.config file, ...
Extending ASP.NET Health Monitoring Events The Analysis bufferModes element is already configured in the root Web.config file and does not have to be declared again in an application-level Web.config ...
Avoid IISRESET in ASP.NET applications (added bonus: ASPRESET ... NET applications (added bonus: ASPRESET). If we referenced external .config files and if we change them on fly i think the worker process should not start. ...
TheMSsForum.com >> Csharp >> C# Console application does not show ... Thank you all, Rob K Tag: C# Console application does not show System. .... Net 2003 and am trying to get the app.config file copied to the directory of the ...
A Simple Two-Dimensional Configuration File / Samples / ASP. NET ... NET may overwrite this file and change all of your settings and result in ... One that I know of is called "configuration application block" which can be ...
.NET Documentation Tool: Version History Saving the configuration file now shows the filename of the configuration file that is .... NET/C# Windows Forms and Console applications as well as ASP. ...
Ban Man Pro 9 Upgrade for ASP.NET 2/SQL Server from 2.1 Set the database connection in the web.config file located in the ... Make sure the folder holding Ban Man Pro is an application starting point. ...
.NET Junkie - ASP.NET Provider Model Template for Visual Studio ... NET application, including console and forms applications. ... As an example how to load values from the configuration file, this provider collects a ...




Search This Site:










bizarre: null reference throws an exception then becomes populated during break

remote debbuging error

keyboard problems in visual studio 05

setting free form text format

a replacement for <asp:contentpager>

compile time error: ticks must be between datetime.minvalue.ticks and datetime.maxvalue.

need my datas in japaneese

timer object blocks form thread

need help creating a report in asp.net

how to create a custom dataprovider so i can use it with the dataset inasp.net

a little problem i found with vs 2005 and ie7

scrollbars are missing

datetime formatexception when casting string to short

changing the default dev environment after install

vs2005 style builder not showing existing css

visual studio is busy...

web deploy project.

how do i design custom installation in vb.net

referring dll

use of <!--#include file="somepage.aspx"--> tag in my application

copying dll's to another folder

web deployment projects

"clean solution" --- what;s happening here?

visual studio lagg

design mode scrollbar is missing

web deployment projects issues

vs standart and pro ?

hierarchical vdir name in web deployment project

what is better to hold a value for display

getting an existing precompiled site into vs

  Privacy | Contact Us
All Times Are GMT