views:

31

answers:

2

Scenario: I have a bunch of web applications for which I want to add a simple ping functionality via http handler. Example: Http://myserver/foo/testfolder/ping.me

Problem: For some of the applications this approach does not work becasue of custom HttpModule. These modules have some depedency on either authentication or some other processing logic due to which it makes the request invalid.

I am trying to find a solution to get this ping functionality work without making any changes to existing HttpModules.

A: 

Assuming you're wanting to disable HttpModules for only the URL to the ping handler, you can do this in your web.config:

<location path="/url/to/ping/handler">
    <system.web>
        <httpModules>
            <remove name="moduleToRemove1"/>
            <remove name="moduleToRemove2"/>
        </httpModules>
    </system.web>
</location>

This will disable the modules for the given url only.

Craig Quillen
This does not work. The http modules are still being invoked.
imasud
Yeah, looks like you can't modify http modules in anywhere except the root config. I had never tried it before and just assumed they acted like everything else.You would have to set the sub folder as it's own web application in IIS.
Craig Quillen
A: 

HttpModules are associated with the application instance and applies to all sub folders. Hence you cannot bypass it.

imasud