Problems removing an HttpModule for a sub directory.

G

Guest

Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one of
the HttpModules from executing. My attempts using the <remove> element to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuration>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam.MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server 2003.
I'm not sure if any other info would be of interest.


Any help would be greatly appreciated.

Thank you,
- Chip Page
 
S

Steve Lutz

Chip,
Have you tried include the type in the <remove> tag:

Example:

<location path="test">
<system.web>
<httpModules>
<remove name="MyModule" type="HighBeam.MyModule.HighBeamLib" />
</httpModules>
</system.web>

Let me know how that works

Steve
 
G

Guest

Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....
 
B

Bruce Barker

HttpModules are loaded and called at the vdir level (asp.net application).
To have a subdir have its own, you will to make it its own application.

you could add the filtering to to your module to support subdirs.

-- bruce (sqlwork.com)


london calling said:
Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....

Chip Page said:
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one
of
the HttpModules from executing. My attempts using the <remove> element
to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuration>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam.MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as
though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have
the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server
2003.
I'm not sure if any other info would be of interest.


Any help would be greatly appreciated.

Thank you,
- Chip Page
 
G

Guest

Hi Bruce, thanks for clarifying that. I have filtered in a 'brokering' module
and it works successfully , though it makes for a less pluggable architecture.

Thanks again

jd

Bruce Barker said:
HttpModules are loaded and called at the vdir level (asp.net application).
To have a subdir have its own, you will to make it its own application.

you could add the filtering to to your module to support subdirs.

-- bruce (sqlwork.com)


london calling said:
Hi everyone, I am also having the same problem.

Does the sub directory have to be an application/vroot in its own right to
add/ remove httpmodules ?

If it does it will cause me all manner of problems....

Chip Page said:
Hello,

In my top-level Web.config, I had added a number of httpModules.
In a particular sub-directory in the application, I wish to prevent one
of
the HttpModules from executing. My attempts using the <remove> element
to
remove the HttpModule for a subdir have not worked.

----
My top-level Web.config contains [just the parts of interest]:

<configuration>

<system.web>
<!-- By default, everone gets the module. This part works fine. -->
<httpModules>
<add name="MyModule" type="HighBeam.MyModule, HighBeamLib"/>
<httpModules>
</system.web>

<!-- I don't want to execute MyModule for any /test files.
This part doesn't work though. -->
<location path="test">
<system.web>
<httpModules>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

</configuration>
---

As an experiment, I put in a bogus <blah> element within the httpModules
element like so:

<location path="test">
<system.web>
<httpModules>
<blah/>
<remove name="MyModule"/>
</httpModules>
</system.web>
</location>

but this does not cause an error as I would expect. So it seems as
though
the contents of the <httpModules> element is not being processed.

---

I see the same results when I remove the <location> element from the
top-level Web.config, and add a Web.config in the test sub-dir, and have
the
sub-dir config remove the httpModule.

I'm using .Net Framework 1.1 (Version 1.1.4322 SP1) on Windows Server
2003.
I'm not sure if any other info would be of interest.


Any help would be greatly appreciated.

Thank you,
- Chip Page
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top