I'm running Asp.net MVC application. By default web.config sets all modules to run for all requests which I disabled. I have a custom HttpModule that's responsible for authentication of managed requests.
Part of my web.config looks like this:
<modules>
<add name="CustomAuth" type="..." preCondition="managedHandler" />
</modules>
Then I try to access my site via http://localhost/default.aspx
All works fine. My Handler gets invoked since IIS integrated pipeline thinks it's managed request. Great.
Then I try to access my site via http://localhost/
Suddenly IIS7 thinks this is <b>not managed request</b>. So I put default.aspx on top of Default documents, to convince IIS that this is in did managed request, but to no avail... This should be treated as managed content that's why it's a bug. I should also mention that I'm running NetFx 3.5 SP1. I read elsewhere that this bug didn't exist in previous versions.
So I would like to:
- configure IIS (via management UI or web.config) to run modules certain modules only for managed requests and not for static content as well
- avoid configuring running all modules on all requests
I guess the culprit is StaticFile module. Could I use UrlRewriting module because (AFAIK) it executes before StaticFile module? Any other suggestion?