Enable net.tcp transport protocol in IIS

In the past two days, I have been exploring the shared port in WCF, refer to the following blog

WCF: How to host net.tcp protocol to IIS

[WCF practice] 1. WCF uses net.tcp to host in IIS

The content mentioned in these two blogs solves most of the problems in actual development. Here, according to my own practice, I also summarize and write it here:

According to the above two blog posts, if you still encounter the following error message:


An attempt was made to create a channel to a service that does not support the .Net framework, possibly encountering an HTTP endpoint. Need record type "PreambleAck", found "72"


You can check whether the host attribute in the Service node in the configuration file is configured. Please add the base url of the basic binding under the System.ServiceModel->services->service->host->baseAddresses node

<baseAddresses>
     <add baseAddress="net.tcp://localhost:8004/"/>
</baseAddresses>

Note the port in the above code segment: 8004, the port number here should be the same as the port number of the net.tcp protocol enabled in iis

net binding

After the above two steps are completed, the current binding should be ready to use


Notice:

Whether iis has a cache or restarting iis does not completely release the occupied port number. When the configuration file and the port in the above interface are changed, the original port number can still be used, and restarting iis is still the same (in the iis management interface). Select the server node and click the restart link on the right)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325101996&siteId=291194637