title: "Could not find default endpoint element that references contract"
body: <p>Yes, I know the question is probably a repeat, but bear with me here. I've tried what I've seen in ALL other questions of the same type and STILL haven't managed to get this working.</p>
  
  <p>I'm working with .Net 4.0 in VS2012 Ultimate. I have a class library that's supposed to reference a web service. Going through the usual steps (Add Service Reference > enter service URI > Go > find the available service > give it a name > OK) creates the service reference and adds a <code>system.serviceModel</code> tag in the <code>app.config</code> file of my class library.</p>
  
  <p>This class library is currently being referenced by a WinForms app that's passing data to it, to be validated with the returned data from web service. However, upon creation of the service client object...</p>
  
  <pre><code>SHWS.StaticXMLAPISoapClient wsc =
      new SHWS.StaticXMLAPISoapClient();
  </code></pre>
  
  <p>...the code crashes with the error noted in the question title, "Could not find default endpoint element that references contract 'SHWS.StaticXMLAPISoap' 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 contract could be found in the client element."</p>
  
  <p>I have tried EVERYTHING I've found on the net, from copying the <code>[class library name].dll.config</code> file to the output folder of the WinForms app, to copying the <code>system.serviceModel</code> tag from one config file to the other, and still no luck.</p>
  
  <p>I'm literally at my wit's end. Any help would be VERY appreciated, since this is one of the key points of the app I'm working on at the moment. Apologies for my ridiculous request, and thanks in advance for your time.</p>