Net TCP binding: The URI prefix is not recognized

后端 未结 2 1277
無奈伤痛
無奈伤痛 2020-12-20 21:57

This really is bugging me for a couple of hours. I created the simplest WCF service using a TCP binding.

namespace WcfTcpService
{
    public class TestTcpSe         


        
相关标签:
2条回答
  • 2020-12-20 22:20

    I had same problem and I changed web.config as below:

    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
          <baseAddressPrefixFilters>
            <add prefix="net.tcp://YourBaseUrl"/>
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>

    0 讨论(0)
  • 2020-12-20 22:22

    When you create service that uses netTcpBinding and you want to Add service reference in Visual Studio you should use http address (httpGetEnabled) not actual tcp address the service listens on. So the solution was to set localhost/WcfTcpService/TestTcpService.svc as an url in Add service reference dialog.

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