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 7761087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:03:29+00:00 2026-06-01T14:03:29+00:00

I have searched the web but I cannot find the solution to my problem.

  • 0

I have searched the web but I cannot find the solution to my problem.

I am self hosting my service on XP using nettcpbinding. The config file is as follows:

<system.serviceModel>

    <diagnostics>
      <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
        logMessagesAtTransportLevel="true" />
    </diagnostics>

    <serviceHostingEnvironment aspNetCompatibilityEnabled="false" />

    <services>       
 <service behaviorConfiguration="behaviorconfig"
        name="myservice">
         <host>
          <baseAddresses>
            <add baseAddress="net.tcp://10.1.3.186:8001/myService" />
          </baseAddresses>
        </host>
        <endpoint address=""
               binding="netTcpBinding"
               bindingConfiguration="BindingConfiguration"
               contract="xxx.ISomeService" />

        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />       
      </service>
 </services>
    <bindings>
           <netTcpBinding>
        <binding name="BindingConfiguration" receiveTimeout="10:00:00"
          sendTimeout="10:00:00" maxBufferSize="65536" maxReceivedMessageSize="65536"
          transferMode="Streamed">
          <readerQuotas maxDepth="65536" maxStringContentLength="65536"
            maxArrayLength="65536" maxBytesPerRead="97108864" maxNameTableCharCount="65536" />
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="behaviorconfig">
          <serviceMetadata />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>

      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

AND the selfhost code is

Uri tcpUrl = new Uri("net.tcp://10.1.3.186:8001/myService");
            //Create ServiceHost
            ServiceHost host
            = new ServiceHost(typeof(xxx.SomeService), tcpUrl);
            //Add a service endpoint
            host.AddServiceEndpoint(typeof(xxx.ISomeService)
            , new NetTcpBinding(), "");
            //Enable metadata exchange

            ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
            smb.HttpGetEnabled = false;
            host.Description.Behaviors.Add(smb);
            //Start the Service
            host.Open();

When I try to add a service reference I get the error Error: Cannot obtain Metadata from net.tcp://10.1.3.186:8001/myService/mex

What is wrong here?

  • 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-06-01T14:03:30+00:00Added an answer on June 1, 2026 at 2:03 pm

    Looks like you’re missing the mex endpoint:

    host.AddServiceEndpoint(typeof(IMetadataExchange),MetadataExchangeBindings.CreateMexTcpBinding(), “mex”);

    Slight revision to clarify:
    The mex endpoint is required so that information about what is available on the service can be exchanged. You add this in addition to your main TCP listener. It’s automatically added when using http based services (wsdl, etc)

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

Sidebar

Related Questions

I have searched the web for hours but I can not find anything about
i have searched a lot on the web but can not find the actual
I want to install rsync on windows xp. I have searched the web, but
I have searched the web and have found no definitive solution, so here goes:
Im trying to translate an object without using glTranslate(). I have searched through web
I have searched this web looking for an answer, but it seems that this
I am working on a website using Smarty. I have searched the web to
I'm fairly new to C# but have searched the web for an hour and
I have searched the Web for this, but with no luck. Any idea? Thanks.
I have searched the web but all the ones readily available are where you

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.