title: mex binding error in WCF
body: <p>I am using VSTS 2008 + C# + .NET 3.0. I am using a self-hosted WCF service. When executing the following statement, there is the following "binding not found" error. I have posted my whole app.config file, any ideas what is wrong?</p>
  
  <pre><code>ServiceHost host = new ServiceHost(typeof(MyWCFService));
  </code></pre>
  
  <p>Error message:</p>
  
  <blockquote>
    <p>Could not find a base address that matches scheme http for the
    endpoint with binding MetadataExchangeHttpBinding. Registered base
    address schemes are [https].</p>
  </blockquote>
  
  <p>Full app.config:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;wsHttpBinding&gt;
          &lt;binding name="MyBinding"
              closeTimeout="00:00:10"
              openTimeout="00:00:20"
              receiveTimeout="00:00:30"
              sendTimeout="00:00:40"
              bypassProxyOnLocal="false"
              transactionFlow="false"
              hostNameComparisonMode="WeakWildcard"
              maxReceivedMessageSize="100000000"
              messageEncoding="Mtom"
              proxyAddress="http://foo/bar"
              textEncoding="utf-16"
              useDefaultWebProxy="false"&gt;
            &lt;reliableSession ordered="false"
                 inactivityTimeout="00:02:00"
                 enabled="true" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="Digest"
                 proxyCredentialType="None"
                 realm="someRealm" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="MyWCFService"
                  behaviorConfiguration="mexServiceBehavior"&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="https://localhost:9090/MyService"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="MyBinding" contract="IMyService"/&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="mexServiceBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="True"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  &lt;startup&gt;&lt;supportedRuntime version="v2.0.50727"/&gt;&lt;/startup&gt;&lt;/configuration&gt;
  </code></pre>