Suppose I have an ASP.NET website running with its corresponding web.config file, which contains a bunch of connectionstrings for database access. I also have a little helper console program (deployed to the same folder as the web app) that does maintenance tasks and other stuff. This helper programs shares a bunch of dll's with the web app, so i have to keep a separate bla.exe.config file for it so the shared dll's find the connection strings and etc. I want to be able to make the console app use the web.config instead of having its own config file.
So far I've managed to load the appSettings at runtime (using ConfigurationManager.OpenMappedExeConfiguration, looping through the appsettingts and adding them dynamically to the ConfigurationManager.AppSettings collection), but the ConfigurationManager.ConnectionStrings member is apparently read-only so i cannot 'inject' the web.config's connectionstrings into it.
Any ideas?