Install Microsoft Enterprise Libraries and Databases

I am trying to use the DatabaseFactory method from Microsoft Enterprise Library.

using Microsoft.Practices.EnterpriseLibrary.Data; 

The error I get is: The type or namespace 'Practices' does not exist in the namespace Microsoft

I tried to go to the Microsoft website to install the corporate library, having worked through the installation process, and it still does not work. I installed it in the wrong place? Any ideas?

Edit: I followed Kev’s directions and everything worked. Thanks for helping your guys.

+6
enterprise-library
source share
2 answers

You need to add links to your project:

Microsoft.Practices.EnterpriseLibrary.Common.dll Microsoft.Practices.EnterpriseLibrary.Data.dll

Assuming you installed Enterprise Library 4.1 - October 2008 , the default installation location will be:

C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\

You can find the assemblies needed for the link:

C:\Program Files\Microsoft Enterprise Library 4.1 - October 2008\Bin

These assemblies are also listed in the Add Links (.NET) dialog box:

Enterprise Library Data Access Application Block
Enterprise Library Shared Library

+5
source share

Make sure you add a link to your project. Follow the instructions here:

http://msdn.microsoft.com/en-us/library/cc511706.aspx

From this article, you will also need a few other links:

  • Add a link to the assembly of the data access application block. In Visual Studio, right-click the node project in Solution Explorer and select Add Links. Click the Summary tab and browse to the assembly location of Microsoft.Practices.EnterpriseLibrary.Data.dll. Select an assembly and click OK to add the link.

  • Following the same procedure, add links to the assembly of the main corporate libraries: Microsoft.Practices.EnterpriseLibrary.Common.dll and Microsoft.Practices.ObjectBuilder2.dll. *

Let us know how you did it.

+1
source share

All Articles