Click here to Skip to main content
15,892,643 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Service Application which has the following web.config file:

XML
<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
   
    <standardEndpoints>
      </standardEndpoints>
    <bindings>
     </bindings>
    <services>
      <service behaviorConfiguration="metadatabehaviour" name="WCF_Service.HistorianService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration=""
          contract="WCF_Service.IHistorianCollectorService" />
        <endpoint address="net.tcp://localhost:8081/mex" binding="mexTcpBinding"
          contract="IMetadataExchange" />
        <endpoint address="net.tcp://localhost:8081" binding="netTcpBinding"
          contract="WCF_Service.IHistorianCollectorService" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="metadatabehaviour">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
  
</configuration>


And I am getting the following error: Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.I can successfully run the service if I am just implementing the "basicHttpBinding" but as soon as I introduce a "netTcp" binding, I start getting this error. I have changed the 'mex' binding to 'mexTcpBinding' but still the error persists. I have tried toggling the relevant properties. Any idea how I can correct this error?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900