0

I'm having some issues adding a WCF service reference on a project which is not set as the "StartUp Project". I keep getting "Could not find default endpoint element that references contract ....". and I tried adding the same WCF service reference on my StartUp project and it works fine.

Here's the current app.config client configuration that I use:

<client>
  <endpoint address="http://host:8080/library"
      binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ILibrary"
      contract="ServiceReference.ILibrary" name="WSHttpBinding_IAccountAccess">
  </endpoint>
</client>

not really sure what I'm missing or doing wrong and I already tried entering the complete namespace of the project as the contract.

Thanks,

user3749947
  • 101
  • 1
  • 5
  • 1
    You can have the reference anywhere, but the client config still needs to be in the StartUp project, see http://stackoverflow.com/questions/699644/wcf-error-could-not-find-default-endpoint-element-that-references-contract-us – stuartd Jul 16 '14 at 19:09
  • I did try that, basically copied over the from the other project to the app.config of the startup project. Only thing I changed is the contract in which I specified the complete namespace of where I added the service reference. Still does not work for me. – user3749947 Jul 16 '14 at 19:16
  • Service references don't generally have namespaces. Have you included the library project in the startup project? – stuartd Jul 16 '14 at 20:36
  • When the configuration is in the non-startup project is the "copy to output directory" property set to "copy if newer" or "copy always" for the config file? – r2_118 Jul 16 '14 at 20:41

0 Answers0