Simple Enterprise Library console application refuses to compile

Posted by Vadim on Stack Overflow See other posts from Stack Overflow or by Vadim
Published on 2010-05-01T21:38:24Z Indexed on 2010/05/01 21:57 UTC
Read the original article Hit count: 338

Filed under:
|
|

I just downloaded and installed Microsoft Enterprise Library 5.0. I fired up VS 2010 to play with EL 5 and created a very simple console application. However, it would not compile. I got the following error:

The type or namespace name 'Data' does not exist in the namespace 'Microsoft.Practices.EnterpriseLibrary' (are you missing an assembly reference?)

I added Microsoft.Practices.EnterpriseLibrary.Common, Microsoft.Practices.EnterpriseLibrary.Data, and Microsoft.Practices.Unity references to my project.

Here's the simple code that refuses to compile.

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

namespace EntLib
{
    class Program
    {
        static void Main(string[] args)
        {
            IUnityContainer container = new UnityContainer();
            container.AddNewExtension<EnterpriseLibraryCoreExtension>();
            var defaultDatabase = container.Resolve<Database>();
        }
    }
}

The error above complains about line #2 :

using Microsoft.Practices.EnterpriseLibrary.Data;

Someone probably will point out to a stupid mistake by me, but at the moment I fail to see it.

I tried to remove and add again Microsoft.Practices.EnterpriseLibrary.Data to refences but it didn't help.

© Stack Overflow or respective owner

Related posts about enterprise-library

Related posts about c#