473,406 Members | 2,439 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Is it possible to distribute web.config data into multiple files?

Hi,

Let us say my web.config is keep growing and I want to break the data
logically and still use web.config methods to retrieve the data.
e.g.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="Group Name">
<section name="Section name"> </section>
</sectionGroup>
</configSections>
<system.web>
</system.web>
</configuration>
Is it possible to keep the <sectionGroup name="Group Name"> or
<section name="Section name"> in seperate file?

Thanks In advance,
~SJ
Nov 17 '05 #1
4 3941
Dino,

what does your link about appSettings have to do with this? The question was
if it's possible to do includes in web.config, resulting in the file being
split into multiple config files...

Jerry

"Dino Chiesa [MSFT]" <di****@microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Yes, check this out:

http://msdn.microsoft.com/library/de...ngselement.asp
-Dino
<Microsoft/>

"Shrinivas" <sj**********@yahoo.com> wrote in message
news:ed**************************@posting.google.c om...
Hi,

Let us say my web.config is keep growing and I want to break the data
logically and still use web.config methods to retrieve the data.
e.g.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="Group Name">
<section name="Section name"> </section>
</sectionGroup>
</configSections>
<system.web>
</system.web>
</configuration>
Is it possible to keep the <sectionGroup name="Group Name"> or
<section name="Section name"> in seperate file?

Thanks In advance,
~SJ


Nov 17 '05 #2
Thanks for your reply.

But I was expected on sectionGroup not on appSettings

**********
<configsections>
<sectionGroup name="Group name">
<section name="Section name"> </section>
</sectiongroup>
</configsections>
*********

Thanks In Advance,
Shrinivas Joshi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #3
Ok, now you're just changing your question. If you want to add your own
sections (but still keep everything in one web.config file) you just have to
declare those sections before you use them. Like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="data"
type="System.Configuration.NameValueFileSectionHan dler, System,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<!-- Your regular web.config stuff -->
<data>
<add key="ConnectionString" value="Provider=SQLOLEDB; Data
Source=SqlServer;" />
</data>
</configuration>

and retrieve it like this:

((NameValueCollection)ConfigurationSettings.GetCon fig("data"))["ConnectionSt
ring"]

For some reason type="System.Configuration.NameValueFileSectionHan dler,
System" didn't work, I had to add version, culture and public key token to
the section definition. Also note that there are other section handlers too.

Jerry

"Shrinivas Joshi" <sj**********@yahoo.com> wrote in message
news:OP**************@TK2MSFTNGP09.phx.gbl...
Thanks for your reply.

But I was expected on sectionGroup not on appSettings

**********
<configsections>
<sectionGroup name="Group name">
<section name="Section name"> </section>
</sectiongroup>
</configsections>
*********

Thanks In Advance,
Shrinivas Joshi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #4
I think the only way to do that right now is to write your own section
handler (possibly derived from SingleTagSectionHandler so you won't have to
write the code to read the include tag) that would include your other
configuration files.

Jerry

"Shrinivas Joshi" <sj**********@yahoo.com> wrote in message
news:OD**************@TK2MSFTNGP12.phx.gbl...
Jerry,

We were in the same page. I expected as you said
like "if it's possible to do includes in web.config, resulting in the
file being
split into multiple config files..."

Anyway, Thanks for your reply

Shrinivas

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 17 '05 #5

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

Similar topics

4
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply*...
22
by: Daniel Billingsley | last post by:
Ok, I wanted to ask this separate from nospam's ridiculous thread in hopes it could get some honest attention. VB6 had a some simple and fast mechanisms for retrieving values from basic text...
6
by: Daniel Groh | last post by:
Hi Sirs, Could I use 2 config files in the same solution ? I have 2 projects in my solution (Data - Class Library, MySite - Web Application) But the funcking =/ problem happens because i want the...
6
by: Andrew Connell | last post by:
I have an app where I want virtually everything password protected/secure except for a single directory. That directory handles some custom authentication and contains my login form, but also some...
5
by: BPearson | last post by:
Hello I would like to have several sites share a single web.config file. To accomplish this, I would point the root of these sites to the same folder. Is there any reason why I might not want to...
0
by: John Wallace | last post by:
Hi, I have an initial build of an ASP.NET/C# application (based around a "custom control" with some supporting webforms) that contains the usual mix of: 1) ASP files 2) A single DLL...
4
by: Bennett Haselton | last post by:
If I add this to my web.config file: <authentication mode="Forms"> <forms name=".ASPXUSERDEMO" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> I can configure the...
2
by: Sam | last post by:
Hi All, I have a solution which consists of multiple projects and each of these projects has their own app.config file. The problem is that all of my projects in the solution pull keys from the...
2
by: Fresno Bob | last post by:
I quite like to store variables in the web.config file. However it can make the web.config messy and make deployment fiddly. Is there any way of have multiple web.config files - one with the major...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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,...
0
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...

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.