title: wcf configuration issues (error)
body: <p>Configuration of WCF has been a bane recently.  I have the following configuration:</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
  
      &lt;!-- Set up Custom Behaviors --&gt;
      &lt;behaviors&gt;
  
        &lt;endpointBehaviors&gt;
          &lt;behavior name="jsonBehavior"&gt;
            &lt;enableWebScript /&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
  
  
        &lt;serviceBehaviors&gt;
          &lt;behavior name="WebPostService.Service1Behavior"&gt;
            &lt;serviceMetadata   httpGetEnabled="true"  /&gt;
            &lt;!-- --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
  
  
      &lt;/behaviors&gt;
  
  
      &lt;!-- Set up the binding configuration  --&gt;
      &lt;bindings&gt;
  
        &lt;basicHttpBinding&gt;
          &lt;binding name="SOAPBinding"&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
  
        &lt;webHttpBinding&gt;
          &lt;binding name="JSONBinding"
                   hostNameComparisonMode="StrongWildcard"
                   receiveTimeout="00:10:00"
                   sendTimeout="00:10:00"
                   openTimeout="00:10:00"
                   closeTimeout="00:10:00"
                   maxReceivedMessageSize="1000000"
                   maxBufferPoolSize="2000000"
                   bypassProxyOnLocal="false"
                   useDefaultWebProxy="true" &gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/webHttpBinding&gt;
  
  
      &lt;/bindings&gt;
  
      &lt;services&gt;
  
  
        &lt;service behaviorConfiguration="WebPostService.Service1Behavior"
                 name="WebPostService.WebPostSvc"
        &gt;
  
          &lt;endpoint address="soap"
                    binding="basicHttpBinding"
                    bindingConfiguration="SOAPBinding"
                    contract="WebPostService.IWebPostSvc"
          /&gt;
  
          &lt;endpoint address="json"
                    binding="webHttpBinding"
                    bindingConfiguration="JSONBinding"
                    behaviorConfiguration="jsonBehavior"
                    contract="WebPostService.IWebPostSvc"
  
          /&gt;
  
          &lt;!--    --&gt;
          &lt;endpoint address="mex"
                    binding="mexHttpBinding"
                    contract="System.ServiceModel.Description.IMetadataExchange"
          /&gt;
  
        &lt;/service&gt;
  
      &lt;/services&gt;
  
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Why would I be getting the following error?:  The error seems to be an enigma, because the contract is available as part of the .NET Framework.  I am using .NET 3.5.</p>
  
  <pre><code>[InvalidOperationException: The contract name 'System.ServiceModel.Description.IMetadataExchange' could not be found in the list of contracts implemented by the service 'WebPostSvc'.]
     System.ServiceModel.Description.ConfigLoader.LookupContract(String contractName, String serviceName) +11679727
     System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) +11678779
     System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +55
     System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) +35
     System.ServiceModel.ServiceHostBase.ApplyConfiguration() +69
     System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +190
     System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) +32
     System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +139
     System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +28
     System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +331
     System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11729164
     System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
     System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
  
  [ServiceActivationException: The service '/WebPostSvc.svc' cannot be activated due to an exception during compilation.  The exception message is: The contract name 'System.ServiceModel.Description.IMetadataExchange' could not be found in the list of contracts implemented by the service 'WebPostSvc'..]
     System.ServiceModel.AsyncResult.End(IAsyncResult result) +11599786
     System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
     System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
     System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
     System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75
  </code></pre>