title: WCF hosted in a Web application and compatibility mode
body: <p>I have a WCF service hosted in a web application (IIS). I need to expose 1 end point over <code>wsHttp</code> and the other over <code>netTcp</code>. I am on a IIS7 environment that makes it possible for me to host non HTTP based services. Anyways, when I browse the .<code>svc</code> file using a browser, I get the error:</p>
  
  <blockquote>
    <p>The service cannot be activated because it does not support ASP.NET
    compatibility. ASP.NET compatibility is enabled for this application</p>
  </blockquote>
  
  <p>By googling, I realized that WCF runs in two modes - Mixed and ASP.NET compatible. When I apply the attribute </p>
  
  <pre><code>[AspNetCompatibilityRequirements(
         RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 
  </code></pre>
  
  <p>However, it appears that once I apply this attribute to the Service Contract implementation, I cannot use a non HTTP binding. </p>
  
  <p>How do I set it up so that:</p>
  
  <ul>
  <li>I can support non HTTP endpoints</li>
  <li>I can host the service on a Web app</li>
  <li>I don't create multiple services one with aspnet compatibility turned on and the other turned off</li>
  </ul>