Although you do not want to write the temp configuration file, the best way to do this is to host your services in a separate AppDomain.
Before creating the AppDomain, take the configuration from the database and write it to the file system, and then when creating the AppDomain, specify it in the temp configuration file that you extracted from the database as the configuration source.
Of course, the config in the database should either be a complete app.config file, or you would need to combine it with some kind of template configuration file, in which there would be some other non-serviceModel configuration bits in it for the rest of your applications.
Implementing it this way is a pretty neat solution and works well (used it before).
source share