Why is this?
A config file is somewhere for end use administrators to configure the application. Having multiple config files quickly becomes confusing unless they have very clearly separated usage.
Connection strings and similar configuration items always go into the .exe.config
(or web.config
) file, therefore this is where administrators would expect to find and maintain that information.
Thus there is nothing weird about this. The only weird thing is the EF tooling generating an app.config
in a class library project (but then where else to put it: there may not be an executable project in the solution: or there could be multiple).
Or is it just not possible for a DLL to have an accessible config file?
You can use the System.Configuration
assembly's types to open and process an arbitrary file as a configuration file, so it is possible. But none of the assumptions of a central configuration (eg. passing the name of a configuration string – rather than the configuration string itself – to the EF constructor) will work. See this answer for more information.