繁体   English   中英

WCF 安装程序 class - 找不到引用合同的默认端点元素

[英]WCF installer class - Could not find default endpoint element that references contract

我在客户端项目中有安装程序 class

public override void Install(IDictionary stateSaver)
{
    base.Install(stateSaver);
        using (ServiceReference1.ClientClient client = new ServiceReference1.ClientClient())
        {
            if (!client.Register(Context.Parameters["firstname"], Context.Parameters["lastname"], Context.Parameters["email"], Context.Parameters["password"]))
            {
              throw new InstallException("Email address is already used");
            }
        }
}

结果:在 ServiceModel 客户端配置部分找不到引用协定“ServiceReference1.IClient”的默认终结点元素。 这可能是因为没有找到您的应用程序的配置文件,或者因为在客户端元素中找不到匹配此协定的端点元素。

有什么想法可以解决吗?

WCF 查找YourInstallerAssemblyName.EXE .config 文件,用于配置安装程序代码正在使用的 WCF 客户端(服务参考)。 该文件需要包含您在其中创建服务引用的 app/web.config 文件中的serviceModel元素。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM