FileConfigurationSource and .Net configuration section

Topics: Enterprise Library Core, General discussion
Oct 16, 2009 at 9:07 PM

Hi,

Is it possible to read/write a .NET configuration section ( <System.Web>, <system.serviceModel>) from a second config file using the EntLib FileConfigurationSource?

If yes, is the .Net framework will be able to use the FileConfiguraitonSource to read the .Net Section at run time when my application starts?

I do not figure how to do this?

Thanks,

Eric

 

Oct 19, 2009 at 3:59 AM

Hi,

It is not possible thru the FileConfigurationSource, as far as understand the <System.Web> <system.serviceModel> are sectionGroup(Which the FileConfigurationSource cannot handle) and not config section(which the FileConfigurationSource do handle). In this case I think you will need to use the standard .NET way of reading those sections, you can find one here: http://stackoverflow.com/questions/19589/loading-system-servicemodel-configuration-section-using-configurationmanager

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

 

 

Oct 19, 2009 at 4:42 PM
Edited Oct 19, 2009 at 4:44 PM

You are right, but it’s not really what I’m looking for. 

I was looking for a way to store some configuration section of the <System.Web> and then <system.serviceModel> somewhere else, maybe in a second configuration file using FileConfigurationSource or in a database using a custom ConfigurationSource (like SqlConfigurationSource).  All this to have centralised configuration but not juste for the EntLib configuration section.

 

I found a different approach using a custom ProtectedConfigurationProvider. See:

 

http://www.wrox.com/WileyCDA/Section/Redirecting-Configuration-with-a-Custom-Provider.id-291932.html

Thank you,

Eric

Oct 20, 2009 at 2:34 AM
Edited Oct 20, 2009 at 2:42 AM

Hi, you can also check this out -http://geekswithblogs.net/akraus1/articles/75391.aspx

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com