Using the Configuration Tools

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Enterprise Library information can be found at the Enterprise Library site.

The Enterprise Library configuration tools are graphical tools that allow you to create, change, and validate application block settings without having to manually edit the XML configuration files where they are stored. There are two tools to choose from: the Configuration Editor, which is integrated with Visual Studio, and the Configuration Console, which is a stand-alone tool. These tools display the available configuration settings, the default values that you can change, and information about what each setting means.

To use the Visual Studio Configuration Editor

Open a solution in Visual Studio on a computer where you have installed Enterprise Library.

In Solution Explorer, right-click the configuration file, and then click Edit Enterprise Library Configuration.

Right-click Application Configuration node, point to New, and then click an application block in the list. For example, click Logging Application Block.

The configuration options for that application block display, along with their default values. Right-click and change the configuration options as required. For example, if you are configuring the Logging Application Block and you want to add a flat file trace listener, do the following:

  1. Right-click Trace Listeners, point to New, and then click FlatFile TraceListener.
  2. In the Properties pane next to the FileName property, click the ellipsis button (...), select the target folder for the file, and enter a file name for the trace listener file.

After you make all your configuration changes, click Save on the File menu.

In Visual Studio, the XML Editor is the default editor for .config files. When you double-click a .config file in Solution Explorer, the XML Editor opens. The following procedure describes how to change the default editor.

To set the Visual Studio Configuration Editor as the default editor

  1. Open a project in Visual Studio.
  2. In Solution Explorer, right-click a configuration (.config) file.
  3. Click Open With.
  4. Click Enterprise Library Configuration Editor.
  5. Click the Set as Default button.
  6. Click OK.

To use the Enterprise Library Configuration Console

On the taskbar, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 4.0 — May 2008, and then click Enterprise Library Configuration. This loads the copy of the Configuration Console that uses the strong-named assemblies. If you are using a different set of assemblies, navigate to the appropriate copy of EntLibConfig.exe using Windows Explorer.

On the File menu, click New Application (if you are configuring a new application) or Open Application (if you are configuring an existing application).

Note

When you open an existing application configuration file, the Configuration Console displays the Data Access Application Block if your Machine.config file contains any connection strings. For more information, see Configuration Tool Usage Notes.

Right-click Application Configuration node, point to New, and then click an application block in the list. For example, click the Logging Application Block.

The configuration options for that application block display, along with their default values. Right-click and change the configuration options as required. For example, if you are configuring the Logging Application Block and you want to add a flat file trace listener, do the following:

  1. Right-click Trace Listeners, point to New, and then click FlatFile TraceListener.
  2. In the Properties pane next to the FileName property, click the ellipsis button (...), select the target folder for the file, and enter a file name for the trace listener file.

After you make all your configuration changes, click Save Application on the File menu.

The documentation for each application block contains procedures for configuring it.

Configuration Tool Usage Notes

Here are some additional points about the configuration tools:

  • The configuration tools do not support editing or storing Enterprise Library configuration sections in the Machine.config file. Enterprise Library configuration section information in the Machine.config file can be accessed at run-time, but it cannot be modified at design-time. Therefore, you should not store Enterprise Library configuration information in the Machine.config file.
  • The configuration tools display connection strings stored in the Machine.config file, but they only save connection strings in the application configuration file. If you use the configuration tools to modify connection strings stored in the Machine.config file, the changes will be lost.
  • At run-time, the Data Access Application Block can use connection strings that are defined in the Machine.config file.
  • The configuration tools display connection string information under the Data Access Application Block configuration information. This means that, if there are connection strings defined in the Machine.config file, you will see the Data Access Application Block node when you open any application configuration file, regardless of whether you added the application block to your configuration file.
  • If your application configuration includes a custom provider, you must make the custom provider assembly available to the Enterprise Library Configuration Console. To do this, you can copy the assembly to the same directory as the Configuration Console executable or install it in the global assembly cache. You can also use the DEVPATH environment variable to allow the Configuration Console to locate the custom provider assembly.
  • The <appSettings> sections must be included in a single file and not distributed across multiple files. Examples of files that you cannot edit include the Machine.config file and <appSettings> sections that include the optional file attribute that specifies a relative path to an external configuration file.