简体   繁体   中英

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

i've got installer class in client project

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");
            }
        }
}

Result: Could not find default endpoint element that references contract 'ServiceReference1.IClient' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.

Any ideas to fix it?

WCF looks for a YourInstallerAssemblyName.EXE .config file for configuring the WCF client (Service Reference) your installer code is using. The file needs to contain the serviceModel element from the app/web.config file where you create the Service Reference.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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