<system.serviceModel> in Separate Config file

Nov 18, 2009 at 1:08 PM
//C# .net Code block Starts 

  IConfigurationSource prtlConfigSrc=null;

LogWriterFactory factory =null; 
LogWriter writer = null;
prtlConfigSrc = new FileConfigurationSource("MyConf.config"); 
factory = new LogWriterFactory(prtlConfigSrc);	
writer = factory.Create();
//C# .net Code block Ends

I am having all the web.config stuff in "MyConf.config". I can get the loggingConfiguration details from MyConf.config.
Is it possible to tell the inetmgr to load <system.serviceModel> information in "MyConf.config" also. 
I cant merge my MyConf.config entries into web.config, becoz the web.config is maintained by another team.
So i have to maintain my product entries in separate config file.
Thanks in advance!
Nov 19, 2009 at 1:33 AM

You can use the configSource attribute in the web.config file and point it to the file containing the system.servicemodel section only.  Is this an acceptable solution for you? (Note that the configSource attribute only works for a relative path)




Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.

Nov 19, 2009 at 4:00 AM


Thanks for your reply.

I cant edit the web.config to specify the configSource. And one more thing the other team have their own <system.serviceModel> entries in web.config. And i have to maintain my <system.serviceModel> entries in my separate config file. So the application can load the web.config file(tat stuff is default), and my config's <system.serviceModel> entries too.

Is there is any custom way of doing this?

Thanks in advance!

Nov 19, 2009 at 7:04 PM

I'm looking for something similar - a way to put the <system.servicemodel> configuration for a *win* app (or win service) that hosts a WCF service in a separate file configuration file.  If it's left in app.config, and the application is installed under the \program files tree (where it's supposed to be), the configuration cannot be edited if UAC is turned on.  I need a way to point WCF to it's configuration in \programData\mycompany\myapp\myapp.wcf.config

Lot of things we used to configure in the app.config break under UAC & standard users.


Nov 23, 2009 at 4:31 AM


Anyone here to help us reg. this discussion.

Pls inform us if there is no solution.



Baskaran R

Nov 23, 2009 at 5:41 AM
Edited Nov 23, 2009 at 5:41 AM

I suggest you post this question in other .net forums as the system.servicemodel section is not an entlib configuration section.  I think you can modify the entlib source code to make it recognize that section but there could be other less tedious ways other .net experts can suggest.


Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.