473,654 Members | 3,074 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 2028
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
2773
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
2830
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
20559
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
2869
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
1550
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
2917
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
1904
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
984
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
2351
by: SoulIntruder | last post by:
Hello folks. I have a beginners question. I have such script: <?php $User = $_POST; $Password = $_POST; $Database = $_POST;
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8489
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
8594
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6161
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
5622
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
4149
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...
1
2716
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
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1596
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.