Create new section handeler for your new config section (implement IConfigurationSectionHandler interface)
Add a reference to your new config section and register it with the assembly
public class CustomConfiguration : IConfigurationSectionHandler
{
public object Create(object parent, object input, XmlNode node)
{
///
/// add your logic here ...
///
return new object();
}
}
Set custom configuration section in application start event(global.ascx) and add it to the cache
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="customConfiguration"
type="Root.Client.Configuration.CustomConfiguration, Root.Client.Configuration" />
</configSections>
<customConfiguration>
.....
//
// your custom configuration
//
.....
<customConfiguration>
</configuration>
public override void Application_Start(object sender, EventArgs e)
{
HttpContext.Current.Cache.Insert("CustomConfiguration",
ConfigurationSettings.GetConfig("customConfiguration") as CustomConfiguration);
}