WCF Service Library with NetTcpBinding

后端 未结 5 1713
孤城傲影
孤城傲影 2020-12-18 01:05

I\'m having a tough time with NetTcpBinding.

When I run my WCFservice,I get this:

System.InvalidOperationException: Could not find a base address tha         


        
相关标签:
5条回答
  • 2020-12-18 01:23

    In this section

    <host>          
      <baseAddresses>            
        <add baseAddress="http://localhost:8731/.../" />   
      </baseAddresses>        
    </host>
    

    add a net.tcp:// base address.

    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/" />
        <add baseAddress="net.tcp://localhost"/>
      </baseAddresses>
    </host>
    
    0 讨论(0)
  • 2020-12-18 01:25

    You can share ports, it's not too hard.

    Make sure when selecting enabled protocols in IIS (right click on site -> Manage Web Site -> Advanced Settings) that you DO NOT USE SPACES. If you have "http, net.tcp" instead of "http,net.tcp" it will not work, and instead give you this exact error.

    More information here: http://www.weeksofprogramming.com/post/Could-not-find-a-base-address-Check-for-spaces-in-IIS7.aspx

    0 讨论(0)
  • 2020-12-18 01:33
    1. Verify the Net.Tcp Port Sharing Service is started on the machine
    2. Verify the configuration netTcpBinding portSharingEnabled attribute is true. (In WCF4 you don't need to provide a name on the binding element if you want this binding specification to be the default for net.tcp)
    0 讨论(0)
  • 2020-12-18 01:45

    I'm sure by now you've fixed the issue, but it really is nothing to do with baseAddresses which is what all the bullentin boards lead you to. I found the answer at http://social.msdn.microsoft.com/forums/en-US/wcf/thread/c9f8d99d-89ee-4573-8528-a21b047bad11. Assuming you are using IIS 7.x: right click the virtual directory/application in IIS, select Manage application -> Advanced settings. In the 'Enabled Protocols' section add net.tcp, e.g.: http,net.tcp. This is necessary even if you added this protocol already at the site level.

    0 讨论(0)
  • 2020-12-18 01:49

    Configure net.tcp binding in your IIS site and set enabled protocol as "http,net.tcp using advanced setting".It should work

    0 讨论(0)
提交回复
热议问题