3

I've inherited a c# application that I don't know much about. When I build and publish it I get the following error:

The binding at system.serviceModel/bindings/basicHttpBinding does not have a configured binding named 'BasicHttpBinding_ILan_Structure_WCFService'. This is an invalid value for bindingConfiguration.

This is the code from my web config:

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_ILan_Structure_WCFService">
          <security mode="Transport" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint
        address="https://website.com/Lan_Structure/Lan_Structure_WCFService.svc"
        binding="basicHttpBinding" 
        bindingConfiguration="BasicHttpBinding_ILan_Structure_WCFService" 
        contract="Lan_Structure_WCFService.ILan_Structure_WCFService" 
        name="BasicHttpBinding_ILan_Structure_WCFService"/>
    </client>
</system.serviceModel>

I don't think I understand the error fully because I thought after a bit of Googling that it was referring specifically to this section:

<basicHttpBinding>
        <binding name="BasicHttpBinding_ILan_Structure_WCFService">
          <security mode="Transport" />
        </binding>
 </basicHttpBinding>

So I thought there was a typo here which isn't the case!

bindingConfiguration="BasicHttpBinding_ILan_Structure_WCFService"

I've tried reading these:

https://msdn.microsoft.com/en-us/library/ms733099(v=vs.110).aspx

The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding

And I've tried removing the reference to the binding configuration as per this question:

The binding at system.serviceModel/bindings/wsHttpBinding does not have... error

But I'm a bit lost. Any help would be greatly appreciated!!! Also does anyone know where I can read a bindings for dummy's or something similar? I could do with reading up on this!

Irvin Dominin
  • 30,819
  • 9
  • 77
  • 111
hlh3406
  • 1,382
  • 5
  • 29
  • 46
  • Could you try moving your binding BasicHttpBinding_ILan_Structure_WCFService directly under the node in config? – uTeisT Mar 24 '16 at 12:51
  • @uteist tried that ( put it above ) but still got the same error :( – hlh3406 Mar 24 '16 at 14:00
  • A shot in the dark: could you give your endpoint a different name? In your config, both the binding and the endpoint have the same name. I am just trying to see what is different between your config and mine (which works fine). – ConnorsFan Mar 24 '16 at 14:49
  • @ConnorsFan tried that now, but it didn't work for me unfortunately! – hlh3406 Mar 24 '16 at 14:58
  • Take a backup of the config. Open the WCF Configuration Editor from VS-> Tools. Load the configuration and see if it can correct the errors. You may need to provide some config from backup, in case it gets lost on import. Once config is good, then you can save it. – NitinSingh May 14 '18 at 09:31
  • https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/wcf/basichttpbinding – NitinSingh May 14 '18 at 09:37

1 Answers1

1

just for some one who stumbles on it. In place of

<basicHttpBinding>

use <webHttpBinding>. This should fix the issue.

user3104116
  • 153
  • 1
  • 11