locked
Cannot get service reference for Net.tcp service hosted in IIS7 RRS feed

  • Question

  • Hi

    I've got a service that I want to host in IIS7. The service runs over net.tcp (currently without security), but I am unable to create a service reference to it, or call it, using the net.tcp protocol. My event log is populated with lots of errors related to ASP.NET and System.ServiceModel, 3.0.0.0

    The relevant services are installed and running (net.tcp port sharing service and net.tcp listener adapter).
    O/S : Window7 RTM
    DevStudio: 2008

    I publish the webservice to IIS7 and I get a valid page when navigating to the published .svc file (which tells me to use svtutil.exe and point it at the net.tcp endpoint).
    For that, I get this error :

        The message could not be dispatched because the service at the endpoint address 'net.tcp://gedm-desktop.profiledc01.appdevelop.local/ManageAVMEP/ManageAVMAgent.svc/mex' is unavailable for the protocol of the address.

    Googling the problem leads me down several blind alleys :(

    I cannot determine what is causing the net.tcp listener to keep stopping? Everything is fine if I use the wsHttpBinding.

    Any tips or pointers to a course of action would be appreciated.

    Thanks

    Ged

     
    My event log is full of errors (here is a sample) :
    -------
    An error occurred while trying to listen for the URL '/LM/W3SVC/1/ROOT/ManageAVMEP'. This worker process will be terminated.
     Sender Information: net.tcp
     Exception: System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler/1707556
     Process Name: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .
       at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register()
       at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting)
       at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting)
       at System.ServiceModel.Channels.SharedConnectionListener..ctor(BaseUriWithWildcard baseAddress, Int32 queueId, Guid token, OnDuplicatedViaDelegate onDuplicatedViaCallback)
       at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token)
       at System.ServiceModel.Activation.HostedTcpTransportManager.Start(Int32 queueId, Guid token, MessageReceivedCallback messageReceivedCallback)
       at System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler.OnStart()
       at System.ServiceModel.WasHosting.BaseAppDomainProtocolHandler.StartListenerChannel(IListenerChannelCallback listenerChannelCallback)
     Process ID: w3wp
    -------
    An error occurred while trying to start an app domain protocol listener channel.

    Exception: System.ServiceModel.CommunicationException

    Message: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .

    StackTrace:    at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register()
       at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting)
       at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting)
       at System.ServiceModel.Channels.SharedConnectionListener..ctor(BaseUriWithWildcard baseAddress, Int32 queueId, Guid token, OnDuplicatedViaDelegate onDuplicatedViaCallback)
       at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token)
       at System.ServiceModel.Activation.HostedTcpTransportManager.Start(Int32 queueId, Guid token, MessageReceivedCallback messageReceivedCallback)
       at System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler.OnStart()
       at System.ServiceModel.WasHosting.BaseAppDomainProtocolHandler.StartListenerChannel(IListenerChannelCallback listenerChannelCallback)
       at System.Web.Hosting.ListenerAdapterDispatchShim.StartListenerChannel(AppDomainProtocolHandler handler, IListenerChannelCallback listenerCallback)
       at System.Web.Hosting.ListenerAdapterDispatchShim.StartListenerChannel(AppDomainProtocolHandler handler, IListenerChannelCallback listenerCallback)
       at System.Web.Hosting.ProcessHost.StartAppDomainProtocolListenerChannel(String appId, String protocolId, IListenerChannelCallback listenerChannelCallback)
    -------

    Here is the relevant section of my web.config :

     <system.serviceModel>
      <services>
       <service behaviorConfiguration="ManageAVMServiceBehavior" name="AVM.WebServiceEndpoint.ManageAVMAgent">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="netTcpBinding_IManageAVMAgent" contract="AVM.BaseService.IManageAVMAgent" />
        <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
       </service>
      </services>
      <bindings>
       <netTcpBinding>
        <binding name="netTcpBinding_IManageAVMAgent" portSharingEnabled="true"
            maxBufferSize="2097152" maxBufferPoolSize="524288" maxReceivedMessageSize="2097152">
         <readerQuotas maxDepth="32" maxStringContentLength="2097152" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
         <security mode="None">
          <transport clientCredentialType="Windows"/>
         </security>
        </binding>
       </netTcpBinding>
      </bindings>
      <behaviors>
       <serviceBehaviors>
        <behavior name="ManageAVMServiceBehavior">
         <serviceMetadata />
         <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
       </serviceBehaviors>
      </behaviors>
     </system.serviceModel>

    Wednesday, October 7, 2009 10:52 AM

Answers

  • After much "faffing about" I seem to have solved the issue - or at least made it go away :)
    Steps to take :

    1. Uninstall all IIS components and .Net 3.5.1 Activation services
    2. Reboot
    3. Install IIS components and .Net 3.5.1 Activation services
    4. Reboot

    SvcUtil and VS2008/2010 can now update their references using the Net.Tcp protocol.
    • Marked as answer by Simply Ged Wednesday, October 7, 2009 12:52 PM
    Wednesday, October 7, 2009 12:52 PM

All replies

  • After much "faffing about" I seem to have solved the issue - or at least made it go away :)
    Steps to take :

    1. Uninstall all IIS components and .Net 3.5.1 Activation services
    2. Reboot
    3. Install IIS components and .Net 3.5.1 Activation services
    4. Reboot

    SvcUtil and VS2008/2010 can now update their references using the Net.Tcp protocol.
    • Marked as answer by Simply Ged Wednesday, October 7, 2009 12:52 PM
    Wednesday, October 7, 2009 12:52 PM
  • I have the exact same issue. What is the root cause of this? Thanks.
    Tuesday, May 11, 2010 6:56 PM
  • Also have the same issue. Unlike other postings of this problem online, there's no detail message, just the period:

      The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .

    Trying to uninstall/reinstall everything and will see how that goes.


    Chris
    Saturday, August 28, 2010 1:46 AM
  • Like Ged, uninstalling/reinstalling IIS and WAS and .NET 3.5 components solved the problem.
    Chris
    Monday, August 30, 2010 3:00 PM
  • I also had this issue, and spiralled all over the "universe" :-) searching for information.  Learned a lot, but this is the only post with the solution, so a huge thank you for posting, and I reiterate the key text for search engines...

    Exception Text contained:

    The message could not be dispatched because the service at the endpoint address 'net.tcp://myhost/myuri' is unavailable for the protocol of the address.

     

    Event Log Contained:

    A (newer)

    An error occurred while trying to listen for the URL '/LM/W3SVC/1/ROOT/myservice'. This worker process will be terminated.

     Sender Information: net.tcp

     Exception: System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler/1707556

     Process Name: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .

     

    B (immediately preceding)

    The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .

    Thursday, September 2, 2010 3:54 PM
  • Like Ged, uninstalling/reinstalling IIS and WAS and .NET 3.5 components solved the problem.
    Chris

    and what if it's a clean install?

    I've just installed IIS, WAS and .NET 3.5, 4.0 and still have the same issue.

    What is the fix in this case?

    Friday, October 1, 2010 8:21 AM
  • I'm not sure *why* this fixes the problem but I found the answer here: http://www.go4answers.com/Example/nettcplocalhost80myservice-41524.aspx

    1. Open a command prompt (cmd.exe) as Administrator.

    2. cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319

    3. ServiceModelReg.exe -r

    This worked for me.


    Benjamin Day - Microsoft MVP for Visual Studio ALM - http://blog.benday.com
    • Proposed as answer by Benjamin DayMVP Wednesday, February 16, 2011 11:11 PM
    Wednesday, February 16, 2011 11:11 PM
  • I wonder why servicemodelreg -r did it. Thanks for saving me some time !
    Tuesday, April 19, 2011 5:50 AM
  • thought I would share this. This happened to me this morning. Lost half a day trying to figure it out. Turns out, it was because I shared the folder with the Services were deployed to. Looks like there is a listener of some sort attached to the directory. I shared it simply to copy the files to another location. Kept the share alive and it cause the exact same symptom as above. 
    Wednesday, August 31, 2011 7:21 PM
  • I was getting the same error:

    The message could not be dispatched because the service at the endpoint address 'net.tcp ... is unavailable for the protocol of the address.

    Here is the gist:

    ServiceModel Registration Tool (ServiceModelReg.exe)

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

     

    Good one Benjamin!

    Friday, January 6, 2012 5:33 PM
  • Thanks, Benjamin.

    Your solution with ServiceModelReg -r saved me the day.

    Sunday, March 4, 2012 12:54 PM
  • thats the solution thank you very much, only i want to say that i was doing a mistake because i was writing "cd C:\Windows\Microsoft.NET\Framework\v4.0.30319" without "64" but i wrote "Framework64" and all its right (yes after 3 days)haha regards!!

    Ing. Edwin Gonzalez

    Monday, December 29, 2014 3:34 PM
  • This did it for me too!!! Shortcut to uninstalling
    Monday, January 19, 2015 1:24 PM
  • Executing ServiceModelReg with -r (repair) option worked for me too! 

    Thank you very much!

    Wednesday, June 22, 2016 11:14 AM