Asp.net MVC error with custom HttpModule
- by Robert Koritnik
I have a custom authentication HttpModule that is pretty strait forward. But I want it to run only for managed requests (and not for static ones).
Asp.net MVC automatically adds configuration section for IIS7 web server:
<system.webServer>
   <validation validateIntegratedModeConfiguration="false" />
   <modules runAllManagedModulesForAllRequests="true">
      <remove name="ScriptModule" />
      <remove name="UrlRoutingModule" />
      <add name="ScriptModule"
           preCondition="managedHandler"
           type="System.Web.Handlers.ScriptModule,..." />
      <add name="UrlRoutingModule"
           type="System.Web.Routing.UrlRoutingModule,..." />
   </modules>
   <handlers>
      ...
   </handlers>
</system.webServer>
When I add my own module I also set its preCondition="managedHandler", but since there's runAllManagedModulesForAllRequests="true" on parent <module> element my preCondition is ignored by design (as I read on MSDN).
When I try to set though:
<modules runAllManagedModulesForAllRequests="false">
I get this error:  [image no longer valid]
What else (which other module) do I have to set in web.config to make it work with this setting:
<modules runAllManagedModulesForAllRequests="false">