I have a simple .NET 4 WCF service which I have hosted locally on IIS7.5. Initially I had it hosted using httpBinding
which worked fine. Then I switched it to netTcpBinding
, which after changing the web.config
file accordingly was also working fine. However today it has decided to stop working. I cannot connect to the service using the test client at all, 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 have checked that the non-http activation service is (still) installed; the net tcp listener service is running; net.tcp is in the list of enabled protocols for the site; I have run servicemodelreg.exe -ia
; I have also re-run aspnet_regiis.exe -i
; and finally I have checked the net.tcp binding is on the site.
If I run netstat
I can see something is listening on the port, but I cannot connect to it.
This is driving me nuts, as this morning it was working fine (as it was last week) and now it's just not.
EDIT: If I access the service in IE then I can see it's throwing 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 looking in the web.config
file that doesn't seem to be the case:
<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>