i have two apps. one is winform server end where wcf service is hosted and another is winform client app where i have to add service reference.there is no any svc file. so when i am trying to create service proxy at winform wcf client end just entering the url like
http://localhost:7998/WPFHost/ or
net.tcp://localhost:7997/WPFHost/ for adding service through service reference then getting error.
Metadata contains a reference that cannot be resolved: ‘net.tcp://localhost:7997/WPFHost/’.
here i am pasting my full app.config file data of wcf server end where wcf has been hosted. please guide me what is wrong in the app.config for which adding ervice reference not being able to add.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<services>
<service name="WCFService.Service"
behaviorConfiguration="behaviorConfig">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:7997/WPFHost/"/>
<add baseAddress="http://localhost:7998/WPFHost/"/>
</baseAddresses>
</host>
<endpoint address="tcp"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
contract="ServiceAssembly.IChat"/>
<endpoint address="net.tcp://localhost:7996/WPFHost/mex"
binding="mexTcpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfig">
<serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<netTcpBinding>
<binding name="tcpBinding"
maxBufferSize="67108864"
maxReceivedMessageSize="67108864"
maxBufferPoolSize="67108864"
transferMode="Buffered"
closeTimeout="00:00:10"
openTimeout="00:00:10"
receiveTimeout="00:20:00"
sendTimeout="00:01:00"
maxConnections="100">
<security mode="None">
</security>
<readerQuotas maxArrayLength="67108864"
maxBytesPerRead="67108864"
maxStringContentLength="67108864"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00"/>
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
</configuration>
You should try to create the service proxy to mex address which is at port 7996: