Bug? Enterprise Library Configuration Console overwrites specified FileConfigurationSource file

Topics: Enterprise Library Core, General discussion
Jun 15, 2008 at 7:10 AM

I'm trying to use a FileConfigurationSource configuration object to point at a more fully populated configuration file.  I'm following the steps given in the help (copied below), but as soon as I "Save" the application file, it overwrites both the application file and the file I'm creating a FileConfigurationSource reference.  This must be a bug; creating an empty configuration file when the whole purpose is to create merely a reference is not at all useful.  It even complains if the existing file is read-only.


    Derived from "To use an alternate configuration source "

  1. Start the Enterprise Library Configuration Console or open the configuration file in the Visual Studio Configuration Editor. To use the Configuration Console, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 4.0May 2008, and then click Enterprise Library Configuration.
  2. On the File menu, click New Application (if you are configuring a new application) or Open Application (if you are configuring an existing application).
  3. Right-click the Application Configuration node, point to New, and then click Configuration Sources.
  4. Right-click Configuration Sources, point to New, and then click the type of configuration source you want to use (such as File Configuration Source).
  5. Use the Properties pane to enter the desired configuration properties for the new configuration source. Specifically, provide the name to an existing configuration file.
  6. Select the Configuration Sources node, and then select the SelectedSource property in the Properties pane.
  7. Click the arrow adjacent to System Configuration Source, and then click the configuration source you want to use.
  8. After you make your configuration changes, click File, and then click Save Application.

Result:  Both the New Application configuration file and the file referred to in step 5 will be overwritten by the Save. 
Expect:  Only save the New Application configuration file.  No useful information can be written to the file referred to in step 5, more likely the file is supposed to exist already.


Jun 16, 2008 at 3:26 PM
Hi John,

This behavior is actually by design. The tool is used to author configuration, so it will try to save all configuration -except the meta-configuration about sources- to the default configuration source. This default source might be even a non-file-based source, so saving is necessary.

You have a valid point in that it should be easier to reuse an existing configuration file, though.