wcf - reading system.servicemodel section from database -


we have dynamically composed application, in user can add services , operations. application installed on server cluster.

since adding services application involves writing web.config, wondering if possible read system.servicemodel section database instead of web.config.

seems microsoft's implementation of configuration tightly coupled stored.

there no "out-of-the-box" way that. however, possible.

few feet below, configuration class uses filestream instance can use stream. particular step can replaced custom implementation of iinternalconfighost interface (a lot of properties , methods implement there).

particularly interesting openstreamforread , openstreamforwrite, both returning stream instances. there can put logic pull xml of configuration sections database configurationsection instances , put configurationsection instances xml database.

the next step create instance of configuration class. however, here must dirty because constructor never leaves system.configuration kingdom. need use reflection reach , use it. suggest implementation of iinternalconfigconfigurationfactory wrap reflection magic.

configuration create( type typeconfighost,     params object[] hostinitconfigurationparams ); 

as first parameter pass type of implemented configuration host.

after have configuration instance, can use custom servicehost, channelfactory<t> , duplexchannelfactory<t>.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -