0

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?

rqrar
  • 55
  • 9

1 Answers1

0

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.

Sixto Saez
  • 12,610
  • 5
  • 43
  • 51
  • still doesn't working. I changed file name to Track.exe.config – rqrar Apr 11 '12 at 10:54
  • Try tracing for which config file the installer is trying to open. The [FileMon app](http://technet.microsoft.com/en-us/sysinternals/bb896642) is a good utility for this, just start it up and run your installer. Stop the trace and sort the output by process name so can you walk the files the installer accesses or is attempting to access. – Sixto Saez Apr 11 '12 at 13:19
  • FileMon is nor avaible to download i use Process Monitor, and I can't see any config files to trying open – rqrar Apr 12 '12 at 09:35
  • Look at the [accepted answer](http://stackoverflow.com/questions/54579/wcf-configuration-without-a-config-file?answertab=votes#tab-top) for options on how to configure your client purely in code since the config file approach isn't working for you. – Sixto Saez Apr 12 '12 at 12:48