Friday, April 24, 2009

Tips & Tricks: Microsoft Enterprise Library Configuration

In my projects, I’m using more and more the Microsoft Enterprise Library Logging Application Block as it provides us with an extensible Logging-Framework that is easy to adjust. Even to write to the ULS Log, a simple ULSLogTraceListener can be implemented by inheriting from CustomTraceListener.

However, I found that there are certain tips & tricks worth knowing when developing projects using the Enterprise Library Application Blocks when it comes to configuration:

Configure Visual Studio:

If you want to show any components in design view that are using an Enterprise Application Block, you need to modify the configuration file of the Visual Studio Development Environment application. Otherwise, you will get errors such as “The configuration section for Logging cannot be found in the configuration source.”.

Here is an example for Visual Studio 2008. Go to :\Program Files\Microsoft Visual Studio 9.0\Common7\IDE and locate the file devenv.exe.config.

You need now to add a configuration section for each application block you are using. Here is my example for the logging application block, with an empty configuration:

Configure (Unit) Test projects

Even though the (web) application you are testing has a valid configuration, projects using them for testing or other purposes must have as well a valid configuration, as they are considered the “application”. So if you run into any errors in these projects – make sure you have a configuration file for them!


Article published on :http://www.sharepointblogs.com by

Post a Comment

Blog Popularty Partners

  ©All Right Reserved.

Back to TOP