EnterpriseLibraryCoreExtension not recognized RRS feed

  • Question

  • User-1213262409 posted

    Hi all,
    at page 17 of the book "Developer's Guide to Microsoft Enterprise Library" by Microsoft Press, there is the following code:

    var theContainer = new UnityContainer().AddNewExtension<EnterpriseLibraryCoreExtension>();

    but if I compile my WinForm I got this error:

    Error 1 The type or namespace name 'EnterpriseLibraryCoreExtension' could not be found (are you missing a using directive or an assembly reference?) C:\Users\Luigi\Documents\Visual Studio 2008\Projects\FormLib5\FormLib5\Form1.cs 41 69 FormLib5

    and I already have the following dll's:

    using Microsoft.Practices.EnterpriseLibrary.Logging;
    using Microsoft.Practices.EnterpriseLibrary.Common;
    using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
    using Microsoft.Practices.Unity;

    What's wrong with it?

    Thanks in advance.


    Monday, April 11, 2011 4:17 AM

All replies

  • User1661032823 posted

    This might be late for the original question, but for the benefit of people who land here from a Bing/Google search:

    There are two possible reasons you are not able to see EnterpriseLibraryCoreExtension:

    1) You are using EntLib 5.0 and 

    - You have not yet added a reference to the assembly Microsoft.Practices.EnterpriseLibrary.Common

    - If you have that reference, you need to add a "using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Unity"

    2) You are using EntLib 6 - in this case, you'll never find the class as it has been discontinued Smile

    The way here is to use the Enterprise libraries Configuration API and accomplish your objectives.

    Thursday, August 1, 2013 6:22 AM