Entlib Configuration based not working

Topics: Enterprise Library Core, Exception Handling Application Block, General discussion
Sep 30, 2014 at 12:33 AM
Until Entlib4.1 I saw the behavior of making the things configurable, I don't know what changed I see a now everything need to be done in the coding. Could you provide a sample of the approach ?
Oct 1, 2014 at 2:06 AM
The preferred approach these days is to use a flexible programmatic approach. However, Enterprise Library still supports all the configuration approaches that you know and love. So, with Enterprise Library 6 you can still use a declarative XML approach especially if you are migrating from older versions. In addition, the fluent configuration approach of Enterprise Library 5 is also still supported. So there are a variety of configuration approaches available and you can choose the one that you prefer or that suits your needs best.

The Developer's Guide to Microsoft Enterprise Library has examples of how to configure using the new programmatic approach. For example:
// Formatter
TextFormatter briefFormatter = new TextFormatter(...);

// Trace Listener
var flatFileTraceListener = new FlatFileTraceListener(

// Build Configuration
var config = new LoggingConfiguration();

config.AddLogSource("DiskFiles", SourceLevels.All, true)

LogWriter defaultWriter = new LogWriter(config);
Randy Levy
Enterprise Library support engineer
Support How-to