title: How to make configuration from an xml file for WCF service
body: <p>I am new here. I want create a WCF WebService using Visual Studio and use it in Xamarin Forms application. This is my ultimate goal. Now I created WCF Service project and starts IIS service on my Mac machine(Windows 8 OS). But When I run the code already given in project to check whether things are alright or not, I am getting following error :</p>
  
  <blockquote>
    <p>Failed to add a service. Service metadata may not be accessible. Make
    sure your service is running and exposing metadata.</p>
  </blockquote>
  
  <p>My Web.config file is as below :</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="aspnet:UseTaskFriendlySynchronizationContext" value="true"/&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.5.2"/&gt;
      &lt;httpRuntime targetFramework="4.5.2"/&gt;
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior&gt;
            &lt;!-- To avoid disclosing metadata information, set the values below to false before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;protocolMapping&gt;
        &lt;add binding="basicHttpsBinding" scheme="https"/&gt;
      &lt;/protocolMapping&gt;
      &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/&gt;
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
      &lt;!--
          To browse web app root directory during debugging, set the value below to true.
          Set to false before deployment to avoid disclosing web app folder information.
        --&gt;
      &lt;directoryBrowse enabled="true"/&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Service.svc file :</p>
  
  <pre><code>&lt;%@ ServiceHost Language="C#" Debug="true" Service="Service" CodeBehind="~/App_Code/Service.cs" %&gt;
  </code></pre>
  
  <p>Service.cs file :</p>
  
  <pre><code>public class Service : IService
  {
      public string GetData(int value)
      {
          return string.Format("You entered: {0}", value);
      }
  
      public CompositeType GetDataUsingDataContract(CompositeType composite)
      {
          if (composite == null)
          {
              throw new ArgumentNullException("composite");
          }
          if (composite.BoolValue)
          {
              composite.StringValue += "Suffix";
          }
          return composite;
      }
  }
  </code></pre>