I have a simple .NET 4 WCF service that I hosted locally on IIS7.5. I originally used it with httpBinding , which worked fine. Then I switched it to netTcpBinding , which after modifying the web.config also worked fine. However, today he decided to stop working. I cannot connect to the service using the test client, getting:
URI: net.tcp://localhost/case/service.svc/mex Metadata contains a reference that cannot be resolved: 'net.tcp://localhost/case/service.svc/mex'. The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost/case/service.svc/mex' is unavailable for the protocol of the address.
I verified that the non-http activation service (still) is installed; listening service net tcp launched; net.tcp is in the list of allowed protocols for the site; I ran servicemodelreg.exe -ia ; I also restarted aspnet_regiis.exe -i ; and finally i checked the net.tcp binding on the site.
If I run netstat , I can see that something is listening on the port, but I cannot connect to it.
It drives me crazy, as it was working fine this morning (as it was last week), and now it's just not so.
EDIT: If I access the service in IE, I see that it throws the following exception:
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
But if you look in the web.config , which seems to be wrong:
<services> <service behaviorConfiguration="ServiceBehavior" name="[REMOVED].[REMOVED]"> <endpoint binding="netTcpBinding" bindingConfiguration="PortSharingBinding" contract="[REMOVED].[REMOVED]" /> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /> </service> </services> <bindings> <netTcpBinding> <binding name="PortSharingBinding" portSharingEnabled="true"> <security mode="None"/> </binding> <binding name="mexTcpBinding" portSharingEnabled="true"> <security mode="None" /> </binding> </netTcpBinding> </bindings>
source share