473,890 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Include an XML file in web.config

Suppose I have a web.config. I'd like to move some configuration
settings from this web.config and put it another XML file (say,
common.xml). Now, is there any way that I can modify the web.config
such that it will include (dynamically) the common.xml?

In other words, System.Configur ation.Configura tionSettings.Ge tConfig
can read settings in common.xml as they were in web.config.

Furthermore, when I load web.config into XML DOM object, the DOM
object will also contain the content in common.xml.

Thanks
Dominic
Nov 18 '05 #1
4 2037
I suspect about the best you could do is store a path in your web.config to
your XML file. Then you'll have to handle your XML file separately. You
could create a class that encapsulates all this though.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
Suppose I have a web.config. I'd like to move some configuration
settings from this web.config and put it another XML file (say,
common.xml). Now, is there any way that I can modify the web.config
such that it will include (dynamically) the common.xml?

In other words, System.Configur ation.Configura tionSettings.Ge tConfig
can read settings in common.xml as they were in web.config.

Furthermore, when I load web.config into XML DOM object, the DOM
object will also contain the content in common.xml.

Thanks
Dominic

Nov 18 '05 #2
Why not simply create a new configuration setions in web.config using
<configSections >

S

"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
Suppose I have a web.config. I'd like to move some configuration
settings from this web.config and put it another XML file (say,
common.xml). Now, is there any way that I can modify the web.config
such that it will include (dynamically) the common.xml?

In other words, System.Configur ation.Configura tionSettings.Ge tConfig
can read settings in common.xml as they were in web.config.

Furthermore, when I load web.config into XML DOM object, the DOM
object will also contain the content in common.xml.

Thanks
Dominic

Nov 18 '05 #3
Handling my common.xml and web.config separately is fine as long as
the ASP.NET can read the configuration settings in both common.xml and
web.config.

Now, my question is how to "store a path" in the web.config? Do you
mean that the web.config can somehow contain a path to the common.xml?
If this is the case, this is what I exactly need.

Thanks

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message news:<#N******* *******@tk2msft ngp13.phx.gbl>. ..
I suspect about the best you could do is store a path in your web.config to
your XML file. Then you'll have to handle your XML file separately. You
could create a class that encapsulates all this though.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
Suppose I have a web.config. I'd like to move some configuration
settings from this web.config and put it another XML file (say,
common.xml). Now, is there any way that I can modify the web.config
such that it will include (dynamically) the common.xml?

In other words, System.Configur ation.Configura tionSettings.Ge tConfig
can read settings in common.xml as they were in web.config.

Furthermore, when I load web.config into XML DOM object, the DOM
object will also contain the content in common.xml.

Thanks
Dominic

Nov 18 '05 #4
Thank you, Sam, for your reply, but new config section doesn't work in
my case.

Let me give you the reason why I would like to do this. I have a web
farm environment of N web servers. Some configuration settings in the
web.config are the same for each web server, but some of them are
different. Deploying a new web.config in this environment is a
headache because I can't simply copy the new web.config to all web
servers (since some configuration settings are server-specific)

In order to make the deployment easier, I come up with this idea. I
would like to use "common.xml " to store all the configuration settings
which are indpendent of the web server. All the server-specific
settings can be stored in the individual web.config. If there is any
change in those "common" settings, I can simply make the change in
common.xml, and copy the new common.xml to each server. This will make
the deployment simpler. However, the question is how the web.config
can "include" common.xml.

Dominic
"Sam-I-Am" <sa****@3hgroup .com> wrote in message news:<#I******* *******@TK2MSFT NGP11.phx.gbl>. ..
Why not simply create a new configuration setions in web.config using
<configSections >

S

"Dominic" <do****@hotmail .com> wrote in message
news:2b******** *************** ***@posting.goo gle.com...
Suppose I have a web.config. I'd like to move some configuration
settings from this web.config and put it another XML file (say,
common.xml). Now, is there any way that I can modify the web.config
such that it will include (dynamically) the common.xml?

In other words, System.Configur ation.Configura tionSettings.Ge tConfig
can read settings in common.xml as they were in web.config.

Furthermore, when I load web.config into XML DOM object, the DOM
object will also contain the content in common.xml.

Thanks
Dominic

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2783
by: Doug | last post by:
If I were to write an include with a relative path like include("../conf/config.php"); What is the use? As far as I understand it, the path is relative to the first script that is called by php. In other words, if the current working directory is /www/ and you were
7
2842
by: mark | last post by:
I am designing a website at the moment and looking at the difference between relative and absolute url links which is driving me crazy! I would like to use relative paths, but it is proving very restrictive as to how I design the file structure when it comes to including files. I currently have something like below: folder1 folder2 images ---image1.gif
1
20571
by: daniel kaplan | last post by:
i am a newbie PERL programmer, oldtime C guy here....anyway, i am starting some PERL scripts on a shared LINUX server. i cannot store my MySQL login parametrs in the apache config, since it is shared....so i was suggested this: "Typically the best way to handle mysql password protection is to put it in a "config" file, that will not be rendered as text by the web server, such as config.php. This way if someone calls the file directly,...
4
2893
by: michaaal | last post by:
I have two folders in my website... Folder1 (this is where my #include file is, this is where the style.css is) --Folder2 (Folder2 is inside of Folder1) Folder2 contains a file that has this #include statement... <!--#include file="../include.inc"-->
2
1567
by: Garry Freemyer | last post by:
I wrote a screensaver, via Visual Studio 2003 in C# and I decided a wiser choice for me was to use an xml file to save my configs. Btw: I wonder if this is why every bit of documentation I've found for saving configuration info in an xml file speak of only doing this for web programming in fact, I get the impression that they have been slipped a mickey that made them forget that there are programs out there that are not web based, but I...
6
2930
by: Gideon de Swardt | last post by:
I am trying to do a server side transformation using an xsl:include in my xslt stylesheet. The include stylesheet is stored /Library/abo.Library.xslt and is included in multiple xslts, one example would be /Valuation/ValuationSelect.xslt which is also used on the client side via JavaScript and MSXML2.FreeThreadedDOMDocument.4.0. Client side the include and transformation without any problems but it is when I am trying to do the...
5
1909
by: frazzle | last post by:
I have been developing a system in PHP that uses MySQL. To that end, I have used a config file to hold high level fixed variables (database name, user id, password, etc) and I using "require_once" to get it into my code with no problems. The problem arises from my desire to integrate third party software, such as Wordpress, External Calendar, etc, into my site and have one central location for database configuration. I can successfully...
0
994
by: boomcreation | last post by:
Hi, In want include two personal include file in my machine.config: data1.config data2.config I know it's impossible to add this in the machine.config: <appSettings file="D:\APPS\PARMS\data1.config" />
10
2375
by: SoulIntruder | last post by:
Hello folks. I have a beginners question. I have such script: <?php $User = $_POST; $Password = $_POST; $Database = $_POST;
0
9975
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11212
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10899
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8004
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7154
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5832
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6032
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4655
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.