Alois Kraus


  Home  |   Contact  |   Syndication    |   Login
  133 Posts | 8 Stories | 368 Comments | 162 Trackbacks


Article Categories


Post Categories


Microsoft Enterprise Library for .NET 2.0: Configuration

The long awaited successor of the Enterprise Library for .NET 2.0 is near feature complete and will be finally released in January 2006. From the configuration perspective the main changes are:

  • Configuration Application Block was replaced by the .NET 2.0 System.Configuration classes.
  • Usage of ConfigurationSection and ConfigurationElement for ser/deserialization.
  • Only the Logging Application Block registers to recieve file change notifications.
  • Object Builder from the CAB (Composite UI Application Block) is used for Configuration Factories.
  • Instrumentation can now be configured and is turned off by default.

Configuration of Enterprise Library Application Blocks

Possible configuration scenarios are:

  • All configuration data is in App.config (default).
  • App.config references another config file which contains all configuration data.
  • No App.config but another config file which is located by other means.
  • No config file at all. You can new up the objects directly without the help of ObjectBuilder

If you first want to get your hands dirty with the new System.Configuration Mechansim of .NET 2.0 you can find more infos here. This article describes how to read/write your App.Config and store complex object graphs (e.g. type safe collections) inside your App.config ....
All scenarios except the last one (later post) are described in this article. When you configure your application blocks the default store is the System Configuration Source. With this strategy your App/Web.Config is searched for your configuration settings. You can retrieve configuration values from other config files via the File Configuration Source. Below is an example shown how to refer from your App.Config file to another XML config file which contains common EntLib Application Block settings.

Sample base config to share config setting across several App.Connfig files

Show more ...

posted on Monday, December 12, 2005 12:51 AM