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