title: could not find endpoint element in wcf client app.config error(self-host)
body: <pre><code>&lt;configuration&gt;
      &lt;system.serviceModel&gt;
          &lt;bindings&gt;
              &lt;basicHttpBinding&gt;
                  &lt;binding name="ep1" closeTimeout="00:01:00" openTimeout="00:01:00"
                      receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false"
                      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                      maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                      useDefaultWebProxy="true"&gt;
                      &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                          maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                      &lt;security mode="None"&gt;
                          &lt;transport clientCredentialType="None" proxyCredentialType="None"
                              realm="" /&gt;
                          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
                      &lt;/security&gt;
                  &lt;/binding&gt;
              &lt;/basicHttpBinding&gt;
          &lt;/bindings&gt;
          &lt;client&gt;
              &lt;endpoint address="http://localhost:57582/Service1.svc" binding="basicHttpBinding"
                  bindingConfiguration="ep1" contract="ServiceReference1.IService1"
                  name="ep1" /&gt;
          &lt;/client&gt;
      &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>this is my configuration for client-endpoint in autogenerated app.config file but still i get following error:
  <strong>Could not find endpoint element with name 'ep1' and contract 'ServiceReference1.IService1' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.</strong></p>
  
  <p>i am consuming the service using ::</p>
  
  <pre><code>Service1Client wcf = new Service1Client("ep1")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/97aFE.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>Its working now.i just defined the client endpoint in web.config of whole solutions from the autogenerated app.config file.its working now.</p>