1

Is there any way to inherit settings in the .config file from a subassembly?

Example:

  • Imagine I have an assembly .NET that does something like connect to a database, or a remote WCF service. This assembly is called "Connect.dll", and its config file is "Connect.dll.config".
  • This sub assembly is called from the main program, "main.exe", its config file is "main.exe.config".
  • Is there some way to import the settings from "connect.dll.config" into "main.config", without having to copy the appropriate .xml lines in in by hand?
Contango
  • 76,540
  • 58
  • 260
  • 305
  • My reason for this question? This would make deployment of a standalone assembly much, much easier. Alternatively, if there is some programmatic way of importing the .config file for the subassembly, I'm all ears. – Contango Jan 14 '11 at 11:21
  • You could use `configSection` attribute: http://stackoverflow.com/a/480750/750216 – Răzvan Flavius Panda Jun 12 '15 at 11:35

1 Answers1

1

Unfortunately, no. There is however possible to load configuration from the "Connect.dll.config" manually using the ConfigurationManager API.

Peter Lillevold
  • 33,668
  • 7
  • 97
  • 131