Skip to content
Permalink
Browse files

For reading "taioted" composite.config configuration sections (config…

… file changed since last load) adding a "retry once" strategy. Ensures that multiple package install ations, all changing Composite.config, can run in the same process. Fix  #657
  • Loading branch information...
mawtex committed Mar 14, 2019
1 parent bae4bc1 commit 494190a2629a7ac42efd7a09fcbae28fb6d14f12
Showing with 14 additions and 2 deletions.
  1. +14 −2 Composite/Core/Configuration/FileConfigurationSourceImplementation.cs
@@ -1,4 +1,4 @@
//===============================================================================
//===============================================================================
// Microsoft patterns & practices Enterprise Library
// Core
//===============================================================================
@@ -9,6 +9,7 @@
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================

using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using System.Collections.Generic;


@@ -47,8 +48,19 @@ public FileConfigurationSourceImplementation(string configurationFilepath, bool
public override System.Configuration.ConfigurationSection GetSection(string sectionName)
{
System.Configuration.Configuration configuration = GetConfiguration();
System.Configuration.ConfigurationSection configurationSection;

System.Configuration.ConfigurationSection configurationSection = configuration.GetSection(sectionName) as System.Configuration.ConfigurationSection;
try
{
configurationSection = configuration.GetSection(sectionName) as System.Configuration.ConfigurationSection;
}
catch (System.Configuration.ConfigurationException ex)
{
// retry once
UpdateCache();
configuration = GetConfiguration();
configurationSection = configuration.GetSection(sectionName) as System.Configuration.ConfigurationSection;
}

SetConfigurationWatchers(sectionName, configurationSection);

0 comments on commit 494190a

Please sign in to comment.
You can’t perform that action at this time.