An endpoint configuration section for contract could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name

Introduction

This fix explained here is helpful if you are using WCF and when you try to access the service, the client throws an exception like “An endpoint configuration section for contract ‘YourContract’ could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name”.

How to fix this exception

WCF service can expose more than one endpoint and client can use any of this endpoint but not more than one at a time. This type of exception occurs when you have more than one endpoint configured at your configuration file (app.config) file while adding service reference or while configuring service at client side manually. You can have only one and only endpoint for the client. If you are getting this exception then check your client side configuration file and make sure the client tag under system.serviceModel has only one endpoint configured.

<system.serviceModel>
   <client>
      <endpoint [...]>
     </endpoint>
   </client>
</system.serviceModel>

Setting Up Kafka

Apache Kafka is a high-throughput, low-latency event processing system designed to handle millions of data feeds per second. It has the c...… Continue reading

Libish Varghese Jacob

Libish Varghese JacobI am a lead engineer at a prominent wind turbine manufacturing firm. My interests span a diverse range, and immersing myself in technology is one of them. This platform serves as my primary knowledge base, where I seek information and insights. Moreover, I utilize this platform to share my experiences and experiments, hoping they may benefit those following a similar path. It's important to note that the suggestions I express here are based on my best knowledge at the time of writing and may not necessarily represent the optimal solutions. I wholeheartedly welcome any comments you may have to improve or refine my ideas. Your feedback is greatly appreciated and valued.