Enterprise Library Tips & Tricks

Last week, Microsoft’s Patterns & Practices team released Patch 2554 for the Enterprise Library 2.0. The main point of this patch is to allow one to use the library in partial trust mode—which is a common scenario with web applications in these dangerous days.

I have been using the libraries quite a while, so I thought I would share some tips and tricks about using the code that I found were not particularly well documented nor advertised.

Trick #1: Get the Libs, Man

There are two current versions of the Enterprise Library: Version 1.1 (aka June 2005) for .NET 1.1 and Version 2.0 (aka January 2006) for .NET 2.0. Download as appropriate & desired.

Trick #2: Do the Labs, Man

The first time I looked at the documentation, I was wondering what the hell I got into. Fortunately I stumbled on the Enterprise Library Hands-On Labs (available for 1.1 and 2.0). I found they were quite well written quickly gave the student the ability to make use of the major features of the library.

Trick #3: Remember to Build for Release

The Enterprise Library is, interestingly enough, released only as source code with an installer. This installer does provide a handy “Build the Enterprise Library” checkbox. But there is a hidden gotcha—it builds the library using the DEBUG, not RELEASE, build setting. This means the code is not fully optimized for production use.

Now, if you are including the projects and compiling them with your solution things will work out just fine. But I, myself, prefer to just statically include the compiled assemblies as I don’t really need to worry about the internals of said library.

In any case, building the library properly is a two step process. First, you must run the release build script. Then you must run the script to copy the assemblies. Presuming one has installed the library to c:projectsEntLib, you will need to fire up a command window and run the following commands in that folder:

c:ProjectsEntLibBuildLibrary Release
c:ProjectsEntLibCopyAssemblies Release

[Note that the sources for Version 1.1 are in the [InstallFolder]src folder, so you will have to go there to find the scripts. Also note that, for Version 1.1, Visual Studio .NET 2003 must be installed for the build script to function.]

After running this, all necessary dlls (and xml documentation) will be avaliable in the bin folder of your enterprise library directory.

Trick #4: InstallUtil

This trick really applies to version 1.1. By default it fires off a number of performance counters and writes to the event log. Now, this is generally not a problem in development. But as soon as one moves the application to the staging server, one gets a nasty “Cannot write to registry” error.

There are two ways around this. First, one can modify the build options so that it does not use performance counters. I have, admittedly, never got this to work successfully. But then again I did not try particularly hard. And I happen to like having performance counters available.

The other option is to use .NET’s InstallUtil.exe utility to register the assemblies. To do so, you need to fire up a trusty command line window and run the following command for each of the library’s assemblies you are using:

C:WINDOWSMicrosoft.NETFrameworkv1.1.4322InstallUtil.exe c:MyAppFolderbinEnterpriseLibraryAssembly.dll

Replacing the path to the assembly as appropriate.


Category: asp.net Time: 2006-07-08 Views: 0

Related post

  • What are your best tips, tricks or formulas for Lightroom's Smart Collections? 2010-11-10

    I use a few Smart Collections in Lightroom to automatically let me see things like all of my finished HDR images, sets of images uploaded to SmugMug or Flickr, and the like, but I'm curious what other ways folks are using Lightroom's Smart Collection

  • The CSS Anthology: 101 Essential Tips, Tricks and Hacks, Chapter 1 - Getting Started with CSS 2004-11-10

    Cascading Style Sheets sound intimidating. The name alone conjures up images of cryptic code and syntax too difficult for the layperson to grasp. In reality, however, CSS is one of the simplest and most convenient tools available to Web developers. T

  • The CSS Anthology: 101 Essential Tips, Tricks and Hacks, Chapter 2 - Text Styling and Other Basics 2004-11-17

    This chapter explores the applications of CSS for styling text, and covers a lot of CSS basics as well as answering some of the more frequently asked questions. If you're new to CSS, these examples will introduce you to a variety of properties and us

  • The CSS Anthology: 101 Essential Tips, Tricks and Hacks, Chapter 3 - CSS and Images 2004-11-24

    Given many of the designs favored by the CSS purists, you'd be forgiven for thinking that the image is soon to be a thing of the past, eschewed in favor of clean, standards-compliant, CSS-formatted, text-based design. However, while sites that rely e

  • The CSS Anthology: 101 Essential Tips, Tricks and Hacks, Chapter 4 - Navigation 2004-12-01

    Unless you limit yourself to one-page web sites, you'll need to design navigation. In fact, navigation is among the most important parts of any web design, and requires a great deal of thought if visitors are to move around your site easily. Making s

  • The PHP Anthology: 101 Essential Tips, Tricks & hacks, 2nd Edition 2007-11-01

    The PHP Anthology: 101 Essential Tips, Tricks & hacks, 2nd Edition is out! This is a big deal for me because it's my first book as a technical editor. It represents several months' work and a considerable amount of coffee. I think it's a great book w

  • 101 Essential CSS Tips, Tricks & Hacks 2009-08-18

    The team at SitePoint is pleased to announce a new edition of one of our most popular books-EVER! The CSS Anthology: 101 Essential Tips, Tricks & Hacks, 3rd Edition An Inspiring Collection of Ready-to-use CSS Solutions By Rachel Andrew The first and

  • When is it appropriate to use Microsoft's Enterprise Library (EntLib)? 2010-09-05

    I'm not exactly sure when to use Enterprise Library, and when not to... and that is making me not learn it at all. I feel that I have enough of a reason to start learning then perhaps one day I'll use it. Are there times when I should use EntLib? Whe

  • Tips/Tricks/Facts Reminder software? 2014-05-01

    I am looking for a simple desktop application in which I can add, remove or edit some items (sentences, pictures, etc.) and it must show one of them (randomly) as a pop-up window on my screen based on a schedule. For example I want to see an item eve

  • Unable to install Enterprise Library 2007 on Windows 7 2015-04-30

    I need Enterprise Library 2007 for my project. When i try installing, it throws the error : Microsoft .Net 2.0 needed . I try to install microsoft .Net 2.0, then it throws the error : .Net 2.0 is already part of the operating system. I uninstalled .n

  • Validation Block not correctly validating properties in Enterprise Library 5.0 2016-01-31

    I have correctly configured validation block using Enterprise Library Configuration Console. My app.config file looks like the following (I only show here validation section): <validation> <type name="XFRop.Settings" defaultRuleset=&quo

  • Entity framework 6 or Microsoft enterprise library for mvc project 2016-02-08

    I'm looking for better architecture for my project which huge data (many stored procedures,views, tables). Could anyone suggest which one is better - EF6 or Enterprise library to interact with data for better performance. I know both are completely d

  • Enterprise Library Console: no Logging Exception Handler 2016-02-09

    I'm developing a new WPF project with C#, Visual Studio 2015 Community, .NET Framework 4.6.1 and Enterprise Library (latest version). I'm trying to use Enterprise Library Console to add a Logging Exception Handler: Do I have to do something to show L

  • Good reference book for OSX (non-obvious tips/tricks) 2009-08-10

    What are some good reference books for learning the subtleties of OSX? I found it fairly easy to pick up, but some things are kinda weird (like switching the default web browser, I had to get my friend who's a Mac expert to guide me through it). Our

  • Selections In Photoshop, Part 4: Tips & Tricks 2009-05-09

    Over this series, we've taken a look at Photoshop's selection tools and how each one has its own appropriate use. The geometric tools for simple shapes, the freehand tools for more complex shapes, and the colour-based selection tools for areas where

  • Must-Know Photography Tips/Tricks 2011-07-27

    A user named Nir posted in another thread about the "Sunny 16" rule, referring to the fact that when shooting in full sunlight, proper settings are usually f16, and then 1/ISO for the shutter speed. What are some other tips or tricks like this?

  • What are some iOS5-only and/or iPhone 4S-only Hidden Tips/Tricks? 2011-10-18

    Possible Duplicate: What tiny thing in iOS 5 makes you smile, or has caught you off guard? Be sure to specify if your tip or trick is for all iOS5 devices, or if it is restricted to the iPhone 4S only. --------------Solutions------------- iOS5 Camera

  • Tips & Tricks - Working with Axure & Fireworks Combined 2012-11-13

    I've used Adobe Fireworks for a number of years for wireframing and hi-fi prototypes. However, I have recently switched over to Axure, as the team i'm working in uses it quite heavily. I was wondering if anybody can recommend any tricks or tips for u

  • iptables Tips & Tricks 2011-03-10

    I'm sure Linux sysadmins are quite familiar with iptables, the userland interface to the netfilter packet-filtering framework. Now, this "Question" is meant to be a Community Wiki for collecting together various bits-n-pieces of iptables wisdom.

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.451 (s). 13 q(s)