title: WCF IMetadataExchange Error
body: <p>I have created a service host with following configuration.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="MathServiceLib.MathService" behaviorConfiguration="myMathServiceBehave"&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:9001/MathService"/&gt;
              &lt;add baseAddress="net.tcp://localhost:9002/MathService"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint address="http://localhost:9001/MathService" binding="basicHttpBinding" contract="MathServiceLib.IMathService"/&gt;
          &lt;endpoint address ="net.tcp://localhost:9002/MathService" binding ="netTcpBinding" contract="MathServiceLib.IMathService"/&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
          &lt;!--&lt;endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/&gt;--&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="myMathServiceBehave"&gt;
            &lt;!--&lt;serviceMetadata httpGetEnabled="true"/&gt;--&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I don't want to use serviceMetadata httpGetEnabled="true" property instead I want to use MEX binding for proxy creation. </p>
  
  <p>Now when I start my service using </p>
  
  <pre><code> svcHost = new ServiceHost(typeof(MathServiceLib.MathService));
   svcHost.Open();
  </code></pre>
  
  <p>I get following error, please help.</p>
  
  <p><strong>The contract name 'IMetadataExchange' could not be found in the list of contracts implemented by the service MathService.  Add a ServiceMetadataBehavior to the configuration file or to the ServiceHost directly to enable support for this contract.</strong></p>