.net 未被引用的错误

  开发的时候遇到了一个错误,如下:

  错误 1 类型“System.ServiceModel.ClientBase`1<T0>”在未被引用的程序集中定义。

我原本以为是版本号的问题,添加了引用也没什么卵用...解决方法如下:

把另一个解决方案的App.config里面的这段代码复制过来就好了

  <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="PubSoap" />
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://www.waterlevel.cn/dbcenter/FetchServices/pub.asmx"
                binding="basicHttpBinding" bindingConfiguration="PubSoap"
                contract="ServiceReference1.PubSoap" name="PubSoap" />
        </client>
    </system.serviceModel>

原文地址:https://www.cnblogs.com/yunquan/p/7364921.html