Could not find a base address that matches scheme net.tcp
Error (WCF): Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
Step 1: Note WAS (Windows Process Activation Service) or non-http protocol support, is only supported by following platforms: • Windows Vista • Windows 7 • Windows Server 2008
- Go to Turn Windows features on or off
- Go to Microsoft .NET Framework 3.5
- Check Windows Communication Foundation HTTP Activation
- Check Windows Communication Foundation Non-HTTP Activation
Step 2: IIS > WCF Host Web Site > Manage Application > advanced Settings > Enabled Protocols > Set the value to HTTP,NET.TCP
You need to define just the base address (not the whole address) for your service, and then the rest in the service endpoint. The address you have with the filetransfer.svc
file at the end is not a valid base address (it's a file address, really)
<service behaviorConfiguration="transferServiceBehavior"
name="API.FileTransfer.FileTransferService">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8001/project/" />
</baseAddresses>
</host>
<endpoint name="MyFileTransferEP"
address = "filetransfer"
binding = "netTcpBinding"
bindingConfiguration="MyFileTransferNetTcpEP"
behaviorConfiguration="NetTcpEPBehavior"
contract="API.FileTransfer.IFileTransferService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
With this, and using self-hosting, your service would be available at the complete address:
net.tcp://localhost:8001/project/filetransfer
Since this is net.tcp and you're self-hosting, there's no need for a svc file at all.
UPDATE: if you want to be able to get metadata on your net.TCP base address, you'll need to expose a net.Tcp MEX endpoint like this inside your <service>
section:
<endpoint name="NetTcpMEX"
address="netTcpMex"
binding="mexTcpBinding"
contract="IMetadataExchange" />
Space in "Enabled Protocols" entry in IIS => Select virtual Directory/application => advanced settings => Enabled Protocols. e.g. http, net.tcp. (Space between protocol text
This should be http,net.tcp (ie. no space between the protocol text)