title: WCF service host cannot find any service metadata
body: <p>I've almost migrated service in ASMX in vb to new WCF 4.0 based, but I can't run it because I get an message at start:</p>
  
  <pre><code>WCF Service Host cannot find any service metadata. This may cause the client application to run improperly. Please check if metadate is enabled. Do you want to exit?
  </code></pre>
  
  <p>I don't know what's wrong with this app.config.</p>
  
  <p>Could you look at it and help me?</p>
  
  <pre><code>WCF Service Host cannot find any service metadata. This may cause the client application to run improperly. Please check if metadate is enabled. Do you want to exit?
  
  &lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"&gt;
        &lt;section name="ExtraWS.My.MySettings" requirePermission="false" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /&gt;
      &lt;/sectionGroup&gt;
    &lt;/configSections&gt;
    &lt;!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="ExtraWS.ExtraBehavior"&gt;
            &lt;serviceMetadata httpGetEnabled="true" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="ExtraWS.ExtraBehavior" name="ExtraWS.Service1"&gt;
          &lt;endpoint address="" binding="basicHttpBinding" contract="ExtraWS.Service1" name ="mex"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding allowCookies="false" bypassProxyOnLocal="false" closeTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" name="PostcodeLookupSoap" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="32" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message algorithmSuite="Default" clientCredentialType="UserName" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding allowCookies="false" bypassProxyOnLocal="false" closeTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" name="C1WSSoap" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="32" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message algorithmSuite="Default" clientCredentialType="UserName" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
          &lt;binding allowCookies="false" bypassProxyOnLocal="false" closeTimeout="00:01:00" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" name="E1Soap" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="32" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /&gt;
            &lt;security mode="Transport"&gt;
              &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt;
              &lt;message algorithmSuite="Default" clientCredentialType="UserName" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="https://postcodews.mycompany.co.uk/PostcodeLookup.asmx" binding="basicHttpBinding" bindingConfiguration="PostcodeLookupSoap" contract="PostcodeService.PostcodeLookupSoap" name="PostcodeLookupSoap" /&gt;
        &lt;endpoint address="https://C1.mycompany.co.uk/C1ws.asmx" binding="basicHttpBinding" bindingConfiguration="C1WSSoap" contract="C1Service.C1WSSoap" name="C1WSSoap" /&gt;
        &lt;endpoint address="https://E1uat.mycompany.co.uk/qbitE1.asmx" binding="basicHttpBinding" bindingConfiguration="E1Soap" contract="E1Service.E1Soap" name="E1Soap" /&gt;
      &lt;/client&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.web&gt;
      &lt;authorization&gt;
        &lt;allow users="*" /&gt;
      &lt;/authorization&gt;
      &lt;compilation debug="true" /&gt;
      &lt;authentication mode="Windows" /&gt;
      &lt;httpHandlers&gt;
        &lt;remove path="*.asmx" verb="*" /&gt;
        &lt;add path="*.asmx" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" verb="*" /&gt;
        &lt;add path="*_AppService.axd" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" verb="*" /&gt;
        &lt;add path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" verb="GET,HEAD" /&gt;
      &lt;/httpHandlers&gt;
      &lt;httpModules&gt;
        &lt;add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
      &lt;/httpModules&gt;
      &lt;membership defaultProvider="ClientAuthenticationMembershipProvider"&gt;
        &lt;providers&gt;
          &lt;add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" /&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;roleManager defaultProvider="ClientRoleProvider" enabled="true"&gt;
        &lt;providers&gt;
          &lt;add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" /&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
    &lt;/system.web&gt;
    &lt;applicationSettings&gt;
      &lt;ExtraWS.My.MySettings&gt;
        &lt;setting name="AlwaysAuthenticate" serializeAs="String"&gt;
          &lt;value&gt;False&lt;/value&gt;
        &lt;/setting&gt;
      &lt;/ExtraWS.My.MySettings&gt;
    &lt;/applicationSettings&gt;
    &lt;appSettings&gt;
      SECRET/&gt;
      &lt;add key="ClientSettingsProvider.ServiceUri" value="" /&gt;
    &lt;/appSettings&gt;
    &lt;connectionStrings&gt;
      SECRET/&gt;
    &lt;/connectionStrings&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /&gt;
    &lt;/startup&gt;
  &lt;/configuration&gt;
  </code></pre>