This seems to be asked a lot on the internet, but so far my research hasn't produced a solution. (And, at least for now, I haven't accepted "it can't be done" as a solution.)
At its simplest description, what I'm trying to do is have a config file in a .NET class library project that is available to that class library in any application that references it. My setup can be simplified to 3 WCF services sharing some domain logic. One of the things they share is an injected dependency of a logger. In this case I have a separate library that implements the logger (this library is what gets injected) using log4net.
In this setup, each of the 3 services has its own config file and each of those config files needs to configure log4net. What I'm trying to do is fully abstract log4net into the separate library so that these 3 services (and future services/applications, of which there will be many) don't have to carry that configuration. They're all going to be configured the same way, so I'd rather it be in one place.
So far I've managed to find some code that will allow a library-localized config file of appsetttings (key/value pairs) and I can access that. But I'm looking for a more complete config file approach. Log4net has a custom configuration section that's more than key/value pairs. (Other config sections are also going to be used across multiple applications, such as the system.serviceModel section in a common library used by client applications to connect to the WCF services).
Does this make sense? Has anybody come up with a solution to this kind of thing before?