zoukankan      html  css  js  c++  java
  • 无法加载协定为“ServiceReference1.LanguageService”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

    解决方案: 

       打开web.config 配置文件  ctrl+f 键  查找"endpoint"  然后手工删除掉原有的才能正常运行。

    错误原因:

      当在vs 2010中添加服务引用后,如果“更新”服务引用,或“删除”该服务引用后再次加入后,在运行时会出现此错误。这是因为在“更新/删除”服务引用时,app.config文件并不会自动修改,在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有的才能正常运行。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebUI.Page11
    {
        public partial class 手机号查询 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                MoblieServiceReference.MobileCodeWSSoapClient moblie = new MoblieServiceReference.MobileCodeWSSoapClient();
                string text = moblie.getMobileCodeInfo(this.TextBox1.Text, "");
                Response.Write(text);
            }
        }
    }
    
    

     当代码执行到“MoblieServiceReference.MobileCodeWSSoapClient moblie = new MoblieServiceReference.MobileCodeWSSoapClient();“时抛出无法加载协定为“ServiceReference1.LanguageService””的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

  • 相关阅读:
    [leetCode]127. 单词接龙
    [leetCode]450. 删除二叉搜索树中的节点
    [leetCode]701. 二叉搜索树中的插入操作
    [leetCode]235. 二叉搜索树的最近公共祖先
    [leetCode]501. 二叉搜索树中的众数
    $Abstract^2 Interpretation$
    图说 Python 内存管理
    Python 解释器初探
    幸福之路
    Spark编程基础
  • 原文地址:https://www.cnblogs.com/chenghu/p/2362957.html
Copyright © 2011-2022 走看看