The Enterprise Library 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.

Application blocks are designed to be used in a variety of enterprise application development scenarios. This design approach allows you to easily adapt an application block to meet the needs of your situation. You do this with configuration settings, which are easily changed using the configuration tools. You can define configuration settings for an application block's central functionality and for each provider type.

Using configuration settings to adapt an application block to a particular situation has two advantages:

  • Different people can configure the characteristics of an application block at different times during the application life cycle. For example, a developer could configure a provider to access a particular database during application development, while a system administrator could decide during deployment to encrypt the database connection strings.
  • You can change the application block configuration incrementally for increasingly complex situations. For example, you could initially configure an application block to use the default settings and providers. As your understanding of the scenario deepens and as your expertise grows, you can change the application block configuration without modifying its code, recompiling it, or redeploying it.

The Enterprise Library includes graphical configuration tools that allow you to create and modify configuration files. The Configuration Editor is integrated with Visual Studio, and there is also a standalone version (the Enterprise Library Configuration Console). Both of these configuration tools have identical functionality. With these configuration tools, you can change and validate application block settings without manually editing the XML configuration files where they are stored. The configuration tools display these settings and supply default values that you can change.

Each application block defines points of extensibility, where developers can include their own implementations (typically, these are providers) with specific functionality. For example, you can add your own custom backing stores to the Caching Application Block. These custom providers can be interchanged with the providers that are supplied with the application block. The configuration console lets you select the custom backing store and writes this information to the appropriate XML configuration file. This means that the application will use the custom store without any code changes and without being recompiled.

Figure 1 illustrates the Configuration Console user interface.

Ff647083.EL-DEV-01-Console(en-us,PandP.10).gif

Figure 1
Configuration Console user interface

Using the Configuration Editor

The Configuration Editor is integrated with Visual Studio. It uses the standard Visual Studio operations to create, open, and save a file. You can open a configuration file by double-clicking it in Solution Explorer. You can also point to Open on the File menu, and then click File and navigate to the file you want to open.

If your file is under source control, the usual rules apply. You can only save changes to a file if you have first checked it out.

The Configuration Editor uses the standard Visual Studio windows and lists to display information:

  • The main Visual Studio window displays the configuration hierarchy.
  • To display and edit a configuration node's properties, you must first select the node in the main window.
  • The standard Visual Studio error list displays any configuration validation errors.

Using the Configuration Console

To use the Configuration Console, click Start on the taskbar, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 3.1, and then click Enterprise LibraryConfiguration.

Building the Configuration Console

The Enterprise Library includes an executable file for the Configuration Console that is located in the correct directory. However, if you customize the Configuration Console source code, you may need to re-compile the source code. You can use the BuildLibrary batch file to do this.

The Configuration Console requires the application block assemblies to be located either in the same directory as the Configuration Console executable file or in the global assembly cache. It requires both the run-time assemblies and the design-time assemblies. Each application packages the design-time support in assemblies that are separate from the run-time implementation. These assemblies are not required for running an application that uses the application blocks. However, the configuration console uses them when you change an application block's configuration. The required assemblies have the suffix .configuration.design.dll. Use the CopyAssemblies batch file to copy the required assemblies into the bin directory.

When you run the CopyAssemblies batch file, it copies all the required assemblies for both run time and design time to the bin directory. For more details about the relationship between the run-time configuration component and the design-time configuration component, see Design-time Configuration.

Note

When the Configuration Console opens an application configuration file, it attempts to load all the provider assemblies referenced in that file. If your application configuration includes a custom provider, you must make the custom provider assembly available to the Configuration Console. To do this, you can copy the assembly to the same directory as the Configuration Console executable file or install it into the global assembly cache. You can also use the DEVPATH environment variable to allow the Configuration Console to locate the custom provider assembly.

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.