skip to the main content area of this page
Patterns and Practices

Environmental Overrides in Enterprise Library 3.0


One of the many challenges of software development is the management and synchronization of application configuration files in the various application environments: Development, Test, Staging, Production, etc. The use of Enterprise Library and its extensive use of configuration information compounds this problem even more.

With Enterprise Library 3.0 this challenge is more manageable through the use of a new feature in the configuration tool called Environmental Overrides. Environmental Overrides allow one to override features in a default configuration file and merge those changes to create an environment specific configuration file. This merging can be done manually or during the build process.

In the Enterprise Library 3.0 Configuration Tool there is a new Configuration Node called Environments.

 

Environmental Overrides

 

One can right-click on the Environments Node and create a new environment, called Production. One specifies the file that will contain the configuration overrides, Production.dconfig, as well as the name of the file to be created when the default configuration settings are merged with the override settings, Production.config.

 

Environmental Overrides Settings

 

Once one or more environments are created, the normal configuration settings in your app.config or web.config file can be overridden. In this case, the ConnectionString in the default app.config file is overridden in the Production Environment to specify the Production Database as opposed to the Test Database.

 

Environmental Overrides Connection String

 

At anytime, one can create the Production Configuration File by right-clicking on the Production Environment Node and specifying Save Merged Configuration. The Saved Merged Configuration Process will merge the default App.config and the override settings in Production.dconfig to create a Production specific configuration file, called Production.config.

 

Environmental Overrides Save Merged Configuration


Tags: EnvironmentalOverrides, EntLibConfigurationEditor


Topics



Popular Tags



Recent Links