Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 794789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:22:15+00:00 2026-05-14T22:22:15+00:00

On hosting my WCF service called SimpleWCF on IIS; I am getting the following

  • 0

On hosting my WCF service called “SimpleWCF” on IIS; I am getting the following error while manually browsing it in my browser;

The contract name ‘IMetadataExchange’ could not be found in the list of contracts implemented by the service SimpleWCF. Add a ServiceMetadataBehavior to the configuration file or to the ServiceHost directly to enable support for this contract.

I cannot understand the cause of this error [still new].

Here is my config file;

<configuration>
  <system.serviceModel>
  <behaviors>
  <endpointBehaviors>
    <behavior name="">
     <webHttp />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<bindings>
  <basicHttpBinding>
    <binding name="LargeData" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
      <security mode="None">
      </security>
    </binding>
  </basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
  <service name="SimpleWCF">
    <endpoint address="http://localhost/Sample/SimpleWCF.svc" binding="basicHttpBinding" bindingConfiguration="LargeData" contract="SimpleWCF"/>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
  </system.serviceModel>
  <system.web>
<compilation debug="true"/>
  </system.web>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:22:16+00:00Added an answer on May 14, 2026 at 10:22 pm

    In your config, you need to give valid names to your behaviors!

    <behaviors>
      <endpointBehaviors>
        <behavior name="webBehavior">
         <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    

    and them from your <service> tag, you need to reference that behavior:

    <service name="SimpleWCF" behaviorConfiguration="serviceBehavior">
    

    for it to become active.

    If you’re on .NET 4 / WCF 4, you can also define default behaviors – but then you need to entirely leave out the name= attribute:

    <behaviors>
      <endpointBehaviors>
        <behavior>
         <webHttp />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    

    Now each endpoint will get that endpoint behavior, and each service will get the service behavior.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The WCF service while hosting with IIS is failing. The web.config for the service
When hosting a WCF service on IIS you have an option of manually configuring
As I am getting Problem while hosting WCF Service on Win 2003 Server. As
I am hosting a WCF service in IIS. Randomly lately I have been getting
I'm hosting a WCF service in IIS 7.5 using .NET 4.0. I also have
First time I am hosting a WCF service on an internal UAT server (IIS
I have a WCF service (MyService.svc) that im hosting under IIS 7.5. My .svc
I was watching a video from plural-sight on hosting a WCF service in IIS
So I'm hosting WCF service in a WinForms application. I have the following [ServiceBehavior(ConcurrencyMode
I hosting a WCF service on Windows 7 IIS. When the service is trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.