I have common issue with WCF and net.tcp binding. I saw all posts on stackoverflow also googling too..
The main problem that I can't add Service Reference to my client. I get error:
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
I'm using IIS 7. I checked non-HTTP.I added to web site in Enable Protocols net.tcp, also added net.tcp to bindings. If I click on browse(http) my address. I see my folder with WCF application, and if I select svc file I see normal address:
svcutil.exe net.tcp://MYADDRESS/Service.svc/mex
I guess that I set my IIS correctly if I see this URL!!
But problem starts when I try to add reference to client. Only that I see http endpoints and no net.tcp.
That's my config on service:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<services>
<service name="MYSERVICE.SERVICE" behaviorConfiguration="behavior1">
<endpoint
binding="netTcpBinding"
contract="MYSERVICE.ISERVICE">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:60745/MYSERVICE/SERVICE/"/>
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="behavior1">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="netTcpBinding" scheme="net.tcp" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Note: my web site starts from 60745 address, but for net.tcp binding in IIS I added 60746:* Also I opened Inbound Outbound rules for both ports.
Thank you!