title: ConfigurationErrorsException: This element is not currently associated with any context
body: <p>I am getting strange exception which seems to me is related to WCF configuration object but what is wrong is completely unclear to me</p>
  
  <p>A first chance exception of type 'System.Configuration.ConfigurationErrorsException' occurred in System.Configuration.dll</p>
  
  <p>Additional information: This element is not currently associated with any context</p>
  
  <pre><code>ServiceModelSectionGroup serviceConfigs =
  ServiceModelSectionGroup.GetSectionGroup(config);
  
  ServiceElement serviceConfig = 
  serviceConfigs.Services.Services[serviceType.ToString()]; &lt;&lt; here exception
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/FpzJF.png" alt="enter image description here"></p>