0

I have a windows application that references a DLL which has a WCF client proxy generated from a WSDL.

What I need to do is have the DLL load its dll.config globally so the client proxy can automatically read the endpoint and binding properties (such as in a regular exe.config).

I'm reading in the Config succesfully in the DLL:

ClientSection clientSettings = ConfigurationManager.OpenExeConfiguration(exeConfigPath).GetSection("system.serviceModel/client") as ClientSection;

The above approach just obtains the section so I can manually read out the properties and initialize my WCF proxy client with them. What I want to avoid is exactly that, is there a way to globally load the configuration so all endpoint configuration is loaded into the libraries system.serviceModel instance?

Dan Hall
  • 1,474
  • 2
  • 18
  • 43
  • You should duplicate the config in the running app's config. – Crowcoder Mar 22 '18 at 12:55
  • ok so no other approach to loading multiple configs and specifcially using them for specific libraries? Only possibility there is to read the data manually? – Dan Hall Mar 22 '18 at 13:03
  • Well, you could try putting a reference to another config file. [see this](https://developers.de/blogs/bahro/archive/2016/02/08/using-external-config-files-in-net-applications.aspx) – Crowcoder Mar 22 '18 at 13:04
  • Thanks Crowcoder, that looks like a good solution here, please post it and i'll mark it the answer. – Dan Hall Mar 22 '18 at 14:08

0 Answers0