Click here to Skip to main content
15,311,561 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a WCF Service that self hosted in a console application with below app.config:
XML
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
  </startup>
    <system.serviceModel>
        <behaviors>
            <serviceBehaviors>
                <behavior name="serviceBehavior">
                    <serviceMetadata httpGetEnabled="false"/>
                </behavior>
            </serviceBehaviors>
        </behaviors>
        <services>
            <service name="TestService.Service" behaviorConfiguration="serviceBehavior">
                <clear />
                <endpoint address="net.tcp://127.0.0.1:7474/Service" binding="netTcpBinding"
                    contract="TestService.IService">                    
                </endpoint>
                <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
                    contract="IMetadataExchange" />
                <host>
                    <baseAddresses>
                        <add baseAddress="net.tcp://127.0.0.1:7474/Service" />
                    </baseAddresses>
                </host>
            </service>
        </services>
    </system.serviceModel>
</configuration>


after I run this console program, i try to connect this service by adding service reference from a client application in another project. but it says:
The URI prefix is not recognized.
Metadata contains a reference that cannot be resolved: 'net.tcp://127.0.0.1:7474/Service'.
The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:04:59.9359963'.
An existing connection was forcibly closed by the remote host
If the service is defined in the current solution, try building the solution and adding the service reference again.

can someone tell me what's the problem ?
I search in google a couple of days but nothing
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