小编Vai*_*hav的帖子

“找不到引用合同的默认端点元素”

在卸载 Windows 应用程序期间调用 webservice 时,我收到错误消息

在 ServiceModel 客户端配置部分中找不到引用合同 ServiceReference2.IService1' 的端点元素。这可能是因为找不到您的应用程序的配置文件,或者因为在客户端元素中找不到与此名称匹配的端点元素。

我正在使用安装程序类,我在其中调用 Web 服务客户端。以下是 installer.cs 的代码

源代码 :

namespace webMiner 
{
    [RunInstaller(true)]
    public partial class demoInstaller : Installer
    {
    SqlConnection conn = new SqlConnection("Data Source=servername;Initial Catalog=comp;User Id=abc;Password=******;");

    public demoInstaller():base()
    {

        InitializeComponent();

         AfterUninstall += new InstallEventHandler(AfterUninstallEventHandler);

    }


    public override void Uninstall(System.Collections.IDictionary savedState)
    {
        base.Uninstall(savedState);
        Int32 flag = -1;
        string keyName = "";

            RegistryKey regeditkey = Registry.CurrentUser.OpenSubKey("sevenuser", RegistryKeyPermissionCheck.ReadWriteSubTree);
        keyName = regeditkey.GetValue("currentuser").ToString();

            webMiner.ServiceReference2.Service1Client sc = new webMiner.ServiceReference2.Service1Client();

            flag = sc.unInstallOperation(keyName);


    }

}
Run Code Online (Sandbox Code Playgroud)

}

其中 …

error-handling wcf endpoint

3
推荐指数
1
解决办法
8605
查看次数

标签 统计

endpoint ×1

error-handling ×1

wcf ×1