将WCF寄宿在托管的Windows服务中
https://www.cnblogs.com/seekdream/p/6821348.html
wcf服务在服务器上可以,在本机上一样的代码,就是无法访问,提示“出错”状态
https://www.cnblogs.com/KimhillZhang/p/5309104.html
采用普通配置文件处理,修改配置文件如下:主要点:<netTcpBinding>
<binding name="NewBinding" maxReceivedMessageSize="2147483647" transferMode="Buffered">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="12000000"/>
<security mode="None">
<transport clientCredentialType="None"></transport>
</security>
</binding>
</netTcpBinding>
代码方式:
binding.TransferMode = TransferMode.Buffered; // hu binding.Security.Mode = SecurityMode.None; // hu binding.Security.Transport.ClientCredentialType = TcpClientCredentialType.None; // hu binding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign; // hu