title: WCF Web.Config - Duplicate Service Names Throwing Error
body: <p>The following code is throwing the error </p>
  
  <p><strong><em>A child element named 'service' with same key already exists at the same configuration scope. Collection elements must be unique within the same configuration scope (e.g. the same application.config file). Duplicate key value:  'Marius.Marius_0_0_8'.</em></strong></p>
  
  <p>Now obviously there are two services named Marius.Marius_0_0_8. But when I try to change the name of one of them to something else I get a different error. I'm assuming that's because the name has to match the name of the namespace &amp; class in the .svc.</p>
  
  <p>I'm tired and have been staring at this for hours. What am I doing wrong? All I'm trying to really do is turn the Metadata on so I can hook up the WCF Test Client.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    --&gt;
  
  &lt;configuration&gt;
      &lt;system.web&gt;
        &lt;compilation debug="true" strict="false" explicit="true" targetFramework="4.5.1" /&gt;
        &lt;httpRuntime targetFramework="4.5.1"  /&gt;
        &lt;customErrors mode="Off" /&gt;
      &lt;/system.web&gt;
  
      &lt;system.serviceModel&gt;
          &lt;behaviors&gt;
  
            &lt;serviceBehaviors&gt;
              &lt;behavior name="Marius.PublishTheMetaData" &gt;
                &lt;!-- Add the following element to your service behavior configuration. --&gt;
                &lt;serviceMetadata httpGetEnabled="true" policyVersion="Policy15" /&gt;
              &lt;/behavior&gt;
            &lt;/serviceBehaviors&gt;
  
              &lt;endpointBehaviors&gt;
                  &lt;behavior name="Marius.MariusAspNetAjaxBehavior"&gt;
                    &lt;webHttp/&gt;
                  &lt;/behavior&gt;
              &lt;/endpointBehaviors&gt;
  
          &lt;/behaviors&gt;
          &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"
              multipleSiteBindingsEnabled="true" /&gt;
          &lt;services&gt;
              &lt;service name="Marius.Marius_0_0_8"&gt;
                  &lt;endpoint address="" behaviorConfiguration="Marius.MariusAspNetAjaxBehavior"
                      binding="webHttpBinding" contract="Marius.Marius_0_0_8" /&gt;
  
              &lt;/service&gt;
  
            &lt;service name ="Marius.Marius_0_0_8" behaviorConfiguration="Marius.PublishTheMetaData"&gt;
  
              &lt;endpoint name="mex"
                    address="mex"
                    binding="mexHttpBinding"
                    contract="IMetadataExchange" /&gt;
            &lt;/service&gt;
  
          &lt;/services&gt;
  
      &lt;/system.serviceModel&gt;
  
  &lt;/configuration&gt;
  </code></pre>