簡體   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