1

Any ideas?

I know this is asked loads because I've checked a load of links/sites such as this SO question: Could not find default endpoint element

The problem is I have done all the copying of the system.serviceModel over to the main App.Config file and even created an APP.CONFIG file (and copied these references over) for all the corresponding projects in the solution... and I am STILL getting the error.

I am using the constructors:

RegistrationService = new BnRegistrationService.RegistrationServiceClient();  

and even tried passing the EndPoint name down too, to no avail.

My system.serviceModel section reads like this:

    <system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ISecurityService" />
            <binding name="BasicHttpBinding_IBidService" />
            <binding name="BasicHttpBinding_IConfigurationService" />
            <binding name="BasicHttpBinding_IRegistrationService" />
        </basicHttpBinding>
    </bindings>

  <client>
    <endpoint address="http://localhost:5166/SecurityService.svc"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISecurityService"
      contract="BnSecurityService.ISecurityService" name="BasicHttpBinding_ISecurityService" />
    <endpoint address="http://localhost:5166/BidService.svc" binding="basicHttpBinding"
      bindingConfiguration="BasicHttpBinding_IBidService" contract="BnBidService.IBidService"
      name="BasicHttpBinding_IBidService" />
    <endpoint address="http://localhost:5166/ConfigurationService.svc"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IConfigurationService"
      contract="BnConfigurationService.IConfigurationService" name="BasicHttpBinding_IConfigurationService" />
    <endpoint address="http://localhost:5166/RegistrationService.svc"
      binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IRegistrationService"
      contract="BnRegistrationService.IRegistrationService" name="BasicHttpBinding_IRegistrationService" />
  </client>
</system.serviceModel>

I am close to tears with this error and I am seeing the error message on so many sites - all saying copy the above into the MAIN app.config file in the windows project but for some (maybe STUPID - on my behalf) reason it's just not working.

I am initialising all these in a BaseForm and all other forms are inheriting this, causing the dreaded Designer Error Screen to show with the error:

"Could not find default endpoint element that references contract 'BnRegistrationService.IRegistrationService' 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."

Any ideas PLEASE?

Thank you so much in advance!!

Community
  • 1
  • 1
Jonny Wilson
  • 177
  • 4
  • 14
  • Did you try updating the Service Reference in the client application. Also make sure that the `RegistrationService` implements the `IRegistrationService` and has `` for its metadata. Did you get the WSDL for this RegistrationService – Saravanan May 18 '13 at 18:26
  • Yeah, I have updated them and gttpGetEnabled is true. The application runs and the BASE FORM displays but any form that inherits the BASE FORM throws the designer error. I am completely at a loss?? :\ – Jonny Wilson May 21 '13 at 15:19
  • If I exclude the App.Config from the MAIN project, the application itself throws this exception. If I include it again, the app runs fine - but the designer throws this exception and I cannot modify the WinForm. – Jonny Wilson May 21 '13 at 21:07

1 Answers1

0

RIGHT! Fixed! NOT my ideal solution but I removed the BASEFORM inheritance from all the other forms and extended FORM as per their default and voila! The error vanished. The BaseForm was in the same project as the other file(s) so I couldn't see a problem relating to the <system.serviceModel> sections being in the wrong .config file in the wrong file(s). For some reason, you can instantiate the WCF services at runtime but this fails miserable in design time if in a BaseForm.

Jonny Wilson
  • 177
  • 4
  • 14