无法加载协定为“NM3.IClrService”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分
<binding name="NetTcpBinding_IClrService1" receiveTimeout="00:10:00" sendTimeout="00:10:00" transferMode="Streamed" maxBufferPoolSize="524288000" maxBufferSize="2000000000" maxReceivedMessageSize="2147483647"> <security mode="None" /> </binding> <endpoint address="net.tcp://132.122.***.**:3366/" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IClrService1" contract="NM3.IClrService" name="NetTcpBinding_IClrService1" />
我的web.config中没有我自己没有搜索出来重复节点配置
于是我指定了webservice的名字
NM3.ClrServiceClient client = new Web.NM3.ClrServiceClient("NetTcpBinding_IClrService1");
然后就没有报错啦~
借鉴了这位大佬的~
https://blog.csdn.net/dongfengkuayue/article/details/38392923?tdsourcetag=s_pcqq_aiomsg