title: Exclude HttpModule from running for static content on IIS7
body: <p>I have a problem with my Authentication HttpModule. The problem is that it obviously runs for every single request I get on my web server (IIS7). Because it also uses Session variable, it fails to work properly on CSS, JS files and similar.</p>
  
  <p>I tried to use:</p>
  
  <pre><code>&lt;add name="AuthModuleName" type="..." preCondition="managedHandler" /&gt;
  </code></pre>
  
  <p>but to no avail. It still runs on every request regardless of its extension or mime type. I should also add, there's a setting</p>
  
  <pre><code>&lt;modules runAllManagedModulesForAllRequests="true"&gt;
  </code></pre>
  
  <p>that seemed suspicious to me and actually disabled preConditions on modules. But changing it to false, breaks the application in a completely different way and with a different exception (The SessionStateTempDataProvider requires SessionState to be enabled).</p>
  
  <p>Can anybody help me how to force IIS7 to exclude my HttpModule when requests are made for static content files?</p>