WCF netTcpBinding hosted on IIS7.5 Stops

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> 
+4
source share
2 answers

OK finally decided. I turned on the net.tcp protocol at the site level, but it was not enabled at the application level. I guess it must have been before, and I think I could create a new application after changing the name of the project before and obviously forgot to install the protocol in the application - doh!

So, the last checklist for hosting the WCF net.tcp service in IIS:

  • Verify that the non-HTTP activation WCF service is installed
  • Verify that the Net.Tcp Listener Service and Net.Tcp Port Sharing are running as
  • Add net.tcp to the allowed protocols for the site and application (to access the "Advanced Settings" parameter from IIS Manager, you need to have an http binding)
  • Run servicemodelreg.exe -ia to register WCF items using IIS
  • Run aspnet_regiis.exe -i to ensure that .NET is configured correctly using IIS
  • Add net.tcp binding to site
+7
source

Have you checked if port sharing is enabled?

see http://msdn.microsoft.com/en-us/library/ms734772.aspx

EDIT - WAS requires one more service:

besides NetTcpPortSharing need the NetTcpActivator service ...

see http://msdn.microsoft.com/en-us/magazine/cc163357.aspx

0
source

All Articles