title: Deploying a WCF Data Service/REST Service on IIS 7.5 localhost
body: <p>Here are the details of my problem. I have one simple WCF Data Service (named WCFServiceAppCBS.svc) using an Entity Framework data access layer that talks to a SqlServer 2008 R2 datasource to return some entities.  I just want to expose a few tables as "GET" to be later consumed by external getJSON/AJAX calls in some html files.  </p>
  
  <p>For development purposes, it works fine when I'm playing around with it in VS2010 using IIS Express and can consume the OData URI and return data.  But, the OData service doesn't return anything when I deploy it to the localhost IIS 7.  </p>
  
  <p>All I get is the Atom Pub feed that lists my entities, but when I try to execute any type of iQueryable statements (i.e. <a href="http://localhost/WCFServiceAppCBS/OData.svc/officers" rel="nofollow">http://localhost/WCFServiceAppCBS/OData.svc/officers</a>), I get a generic "the website cannot display the page".  </p>
  
  <p>I'm not sure if it is having a problem authenticating or if there are other settings in my Web.Config or IIS that I'm missing.</p>
  
  <p>Here's my web.config:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" /&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true" /&gt;
    &lt;/system.webServer&gt;
    &lt;connectionStrings&gt;
      &lt;add name="CBSEntities" connectionString="metadata=res://*/CBSLookup.csdl|res://*/CBSLookup.ssdl|res://*/CBSLookup.msl;provider=System.Data.SqlClient;provider connection string=&amp;quot;data source=QCSQL2K8DEV;initial catalog=CBS;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&amp;quot;" providerName="System.Data.EntityClient" /&gt;
    &lt;/connectionStrings&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Here's my OData.svc.cs...</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data.Services;
  using System.Data.Services.Common;
  using System.Linq;
  using System.ServiceModel.Web;
  using System.Web;
  
  namespace WCFServiceAppCBS
  {
      public class OData : DataService&lt;CBSEntities&gt;
      {
          // This method is called only once to initialize service-wide policies.
          public static void InitializeService(DataServiceConfiguration config)
          {
              // TODO: set rules to indicate which entity sets and service operations are visible, updatable, etc.
              // Examples:
              config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
              // config.SetServiceOperationAccessRule("MyServiceOperation", ServiceOperationRights.All);
              config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
          }
      }
  }
  </code></pre>
  
  <p>Thanks for any help you can provide!</p>