Re: Inherited web.config ASP.NET 2.0
- From: "Juan T. Llibre" <nomailreplies@xxxxxxxxxxx>
- Date: Thu, 10 Aug 2006 07:17:02 -0400
re:
Juan, did you get the same results as Ben?
Hi, Steven.
My results are similar to yours for unconfigured directories down the tree.
I assumed that "inetpub\wwwroot\group1\site1" and the other two sites
( site2 and site3 ) were configured as separate applications.
Hence, the comment that they wouldn't inherit from /group1.
I stand by :
"Root web.config settings are inherited, unless they are overturned
by a different setting in a web.config down the directory tree."
And regret any confusion stemming from :
"If you place a setting in inetpub\wwwroot\group1\web.config,
the setting will be local to the \group1 directory, but the
subdirectories below it will inherit from the root directory."
What I meant to write was :
"If you place a setting in inetpub\wwwroot\group1\web.config,
the setting will be local to the \group1 directory, but the
subdirectories below it will inherit from their application's root directory."
( working on the assumption that the subdirectories are separate apps,
therefore they each have separate application roots, so they would *not*
inherit from a directory placed higher than them in the directory tree)
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:c3jOIhDvGHA.5696@xxxxxxxxxxxxxxxxxxxxxxxx
Hi Ben,
Thanks for the reply and thanks for Juan's inputs.
I don't think there is any difference between your test site and my local
test site's structure.
Juan, did you get the same results as Ben? I've tested this on my local
environment and web.config file inheritance does work as long as the
web.config is put in the parent folder that is in the folder path (to the
leaf application node).
I've attached a screenshot of my local test site's folder structure (in the
default IIS site):
The directory sturecture is
Default Site/
ASPNET/
V2/
WebSites/
.....web applications
Except the "Root Default Site" and the leaf web applications, all the other
directory in the hierarchy are normal virtual directory. I've put
web.config files(only contains some <appSetting> keys) in the following
directories:
*Default Site(root)
*V2
*WebSites
And in the web applications under "Websites", I can use the following code
to get all the appSetting keys defined in all the web.config files above:
=====================
protected void Page_Load(object sender, EventArgs e)
{
foreach (string key in WebConfigurationManager.AppSettings.Keys)
{
Response.Write("<br/>"+ key + ": " +
WebConfigurationManager.AppSettings[key]);
}
}
=====================
#Note, I haven't used any external mapped phyiscal directory for the above
virtual directories, they're all under the inetput/wwwroot. So the physical
direcotry structure is as below:
wwwroot\ASPNET\V2\WebSites\xxxweb applications dirs...
Is there anything different from your test applications? I'm using windows
2003 server/IIS6, ASP.NET 2.0
Please feel free to let me know if there is anything else you wonder or can
help you on this.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
.
- Follow-Ups:
- Re: Inherited web.config ASP.NET 2.0
- From: Steven Cheng[MSFT]
- Re: Inherited web.config ASP.NET 2.0
- References:
- Inherited web.config ASP.NET 2.0
- From: Ben
- RE: Inherited web.config ASP.NET 2.0
- From: Steven Cheng[MSFT]
- Re: Inherited web.config ASP.NET 2.0
- From: Ben
- Re: Inherited web.config ASP.NET 2.0
- From: Juan T. Llibre
- Re: Inherited web.config ASP.NET 2.0
- From: Steven Cheng[MSFT]
- Inherited web.config ASP.NET 2.0
- Prev by Date: Codebehind problem!
- Next by Date: Re: IIS doesn't serve ASP.NET Applications
- Previous by thread: Re: Inherited web.config ASP.NET 2.0
- Next by thread: Re: Inherited web.config ASP.NET 2.0
- Index(es):
Relevant Pages
|