web.config inheritance

  • Thread starter Thread starter Galen Harris
  • Start date Start date
G

Galen Harris

I have the following setup --

wwwroot\web.config

wwwroot\application1\web.config

I have application1 flagged as it's own application within IIS. The
behavior I'm seeing is that application1 still inherits from the wwwroot's
web.config. I thought that if application1 was set as it's own application
within IIS, it would override that inheritance. Seems from postings in
various newsgroups that this is wrong. Is this right?

Is there anyway to have application1's web.config not inherit from its
parent directory's web.config?

Thanks, Galen
 
Hello,

If my suggestion is not clear or you didn't think it can resolve the
problem, please post your comments here. I will continue to follow up on
this issue.

Thanks,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
It seems from your postings that the web.config will inherit from its
parent's directory, based on the URL request path, no matter if it is
configured as its own application within IIS or not.

From what I gather, the only thing configuring a virtual directory or a
directory as its own application does, is give it its own bin directory
where the framework will load assemblies from.

Are both these correct?
 
Hi Galen,

Yes, web.config files always inherit/override. However, it is also realted
to if it is configured as its own application within IIS or not. For
example, we have a web application "webapplication1" and set it to form
authentication in Web.config. If we open:

Http://localhost/webapplication1/somewebform.aspx

it will first redirect to login form

And we add a sub folder under \inetpub\wwwroot\webpllication1\" named
"sub1", and open:

Http://localhost/webapplication1/sub1/somewebform.aspx

It will also redirect to login form since its web.config is inherit.

However, if we create a virtual directory in IIS for sub1 and open

Http://localhost/sub1/somewebform.aspx

It wouldn't redirect to login form.

If we open :

Http://localhost/webapplication1/sub1/somewebform.aspx

It still redirect to login form.

Did I make question clear?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
Back
Top