title: 404 Not Found error when running ServiceStack on IIS8
body: <p>My ServiceStack web service works fine in IIS Express (VS 2012) and when deployed to Windows Azure, but it does not work under IIS 8 on Window 8.</p>
  
  <p>I am getting <code>404 Not Found Error</code>.  My <code>web.config</code> has both sections defined for IIS Express and the web server. </p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
     &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.5"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/assemblies&gt;
        &lt;buildProviders&gt;
          &lt;add extension=".cshtml" type="ServiceStack.Razor.CSharpRazorBuildProvider, ServiceStack.Razor" /&gt;
        &lt;/buildProviders&gt;
      &lt;/compilation&gt;
      &lt;httpRuntime targetFramework="4.5" /&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false" /&gt;
      &lt;handlers&gt;
        &lt;add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" /&gt;
      &lt;/handlers&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <hr>
  
  <h2>Solution:</h2>
  
  <p>Just figured out, through further research, that this resolved my problem:</p>
  
  <ol>
  <li>I switched the application pool to <em>Integrated Mode</em>.</li>
  <li><p>I added the following to <code>web.config</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.webServer&gt;
    &lt;modules runAllManagedModulesForAllRequests="true"/&gt; 
  &lt;/system.webServer&gt;
  </code></pre></li>
  </ol>