0

I have a console app which hosts my wcf services and takes their configuration from app.config (whick then becomes .exe.config). Now i want to move it to {OutputDirectory}/conf. How now can i tell my app to search the config there? I tried to write like this:

private const string CONFIG_FOLDER = "conf\\";
private const string CONFIG_FILENAME = "MyApp.exe.config";

var configPath = Path.Combine(Environment.CurrentDirectory, CONFIG_FOLDER, CONFIG_FILENAME);
var config = new ExeConfigurationFileMap {ExeConfigFilename = configPath};
ConfigurationManager.OpenMappedExeConfiguration(config, ConfigurationUserLevel.None);

But i still get an Exception:

Additional information: Service 'LinProgWebServer.ClientService' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

What am i doing wrong?

I'll by gratefull for any help

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Alex Voskresenskiy
  • 2,143
  • 2
  • 20
  • 29

0 Answers0