Entlib 5.0 custom config files and custom settings

Topics: Building and extending application blocks, Enterprise Library Core, General discussion
May 6, 2010 at 9:13 AM

Hello community,

I have a question about configuration of an application using entlib 5.0.

So it is possible to use the entlib for configuration of an application by using custom config files and custom settingssections.

I don't want to use any applications block of entlib like caching, logging ect. and I don't want to use <appSettings> - Section. What I want to do is to define my own section like

<configuration>
    <configSections>        
        <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
        <section name="myConfigSection" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
    </configSections>    
    <enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
        <sources>
            <add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
        </sources>
    </enterpriseLibrary.ConfigurationSource>
  <myConfigSection name="Application" >
      <add name="ApplactionName" value="TestApplication" />
  </myConfigSection>
</configuration>

perhaps also in different files.

The point is I want to have different config sections for differen parts of my application.

So If it's possible what i the right way to do this ? Is there any editor support for this kind of action ?

Thank you.

Best Regards

Viktor

 

May 6, 2010 at 4:03 PM

I think what you're asking is not specific to entlib. Here's a reference that I think can help on how to create a custom configuration section  http://msdn.microsoft.com/en-us/library/2tw134k3.aspx.

Gino Terrado
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

May 7, 2010 at 1:23 AM

There used to be an Application Block Software Factory in Entlib 3.1 which will provide you with the capability to add editor support for your custom config section.  http://msdn.microsoft.com/en-us/library/ff648810.aspx.  The system requirements though might not be what you have or what you want.

 

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

May 12, 2010 at 10:27 AM

Thanks a lot for your posts.

Viktor