title: load WCF service by environment in .net core project
body: <p>I have a problem while adding WCF in the .NET core project.
  When I used .net in the past I can add multiple environments in <code>web.config</code> so I can load the correct web service at runtime (Dev, Rec, Prod).</p>
  <p>The problem in the .net core project when I added a reference of my WCF service as Connected Service it created one file ConnectedService.json that contains a URL for the WCF service.</p>
  <pre><code>{
    &quot;ProviderId&quot;: &quot;Microsoft.VisualStudio.ConnectedService.Wcf&quot;,
    &quot;Version&quot;: &quot;15.0.20406.879&quot;,
    &quot;GettingStartedDocument&quot;: {
      &quot;Uri&quot;: &quot;https://go.microsoft.com/fwlink/?linkid=858517&quot;
    },
    &quot;ExtendedData&quot;: {
      &quot;Uri&quot;: &quot;*****?singleWsdl&quot;,
      &quot;Namespace&quot;: &quot;Transverse.TokenService&quot;,
      &quot;SelectedAccessLevelForGeneratedClass&quot;: &quot;Public&quot;,
      &quot;GenerateMessageContract&quot;: false,
      &quot;ReuseTypesinReferencedAssemblies&quot;: true,
      &quot;ReuseTypesinAllReferencedAssemblies&quot;: true,
      &quot;CollectionTypeReference&quot;: {
        &quot;Item1&quot;: &quot;System.Collections.Generic.List`1&quot;,
        &quot;Item2&quot;: &quot;System.Collections.dll&quot;
      },
      &quot;DictionaryCollectionTypeReference&quot;: {
        &quot;Item1&quot;: &quot;System.Collections.Generic.Dictionary`2&quot;,
        &quot;Item2&quot;: &quot;System.Collections.dll&quot;
      },
      &quot;CheckedReferencedAssemblies&quot;: [],
      &quot;InstanceId&quot;: null,
      &quot;Name&quot;: &quot;Transverse.TokenService&quot;,
      &quot;Metadata&quot;: {}
    }
  }
  </code></pre>
  <p>My question how can I load the correct service based on the used environment.</p>
  <p><strong>Note.</strong></p>
  <p>In my Project, I did not have an <code>appsettings</code> neither web config. It is a .net core class library and it is called in ASP.NET core Application as Middleware.</p>