"Inheriting" web.config

  • Thread starter Thread starter Jose Perez
  • Start date Start date
J

Jose Perez

Dear All,

We are experiencing a problem with web.config and the fact that it's
settings are being "inherited" other applications.

Our default website is configured to run "MyApplication1". The website
also contains 2 Virtual Directories which run "MyApplication2" and
"MyApplication3". All three applications are .NET projects.
"MyApplication2" inherits a HTTPModule setting from "MyApplication1"
so to fix this we have amended the web.config for "MyApplication2"
with the following code:

<httpModules>
<remove name="HTTPHandler" />
<clear />
</httpModules>

Furthermore we inserted a dummy dll in the bin directory. This has
seemingly fixed the problem we were receiveing.

Now onto my question...is there anything we can do to stop the
web.congif file from being inherited? We have tried to host these all
as Virtual Directories and use some kind of redirecting within IIS to
select the correct application. We have been unable to make this work.
I´m not sure whether this is possible but perhaps is a question for
another newsgroup :-).

Thanks in advance for your help.

Cheers
Jose
 
Make the child directories applications.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
IMO it looks like it takes actually all web.config files since the root
regardless if they belong or not to the same application (and the doc
doesn't mention the behavior in this case, they just talk about subdirs).

I would avoid nested applications storing for example those 3 applications
at the same level...

Patrice
 
I would like to store the web applications at the same level but have
been unable to do so. (I concious of changing the subject of the post
but I'll do it anyway...)

I want 1 application (the main one) to be accessed from the root and any
other application to be accessed as if it were a Virtual Directory. So,
www.domain.com would give me application 1, www.domain.com/app2 would
give me (the separate) application 2 and so on. I have had difficulty in
using IIS to map to the different directories.

Do you have any idea?

Thanks,
Jose
 
Not sure. For non nsedtad applications, I see basically :

- host header names ? (but I believe it applies only to domain names)
- creating virtual dirs for app2 and app3 inside app1 pointing to the
physically non nested applications (depending on how .NET locates web.config
files)
- AFAIK it's quite easy in .NET to do URL rewriting (mapping a "friendly"
URL to your "true" real URL behind the scene)
- Others ?

Good luck.

Patrice
 
Back
Top