Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing Microsoft Enterprise Libraries and DatabaseFactory

I'm attempting to use the DatabaseFactory method from the 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 going to Microsoft's site to install the Enterprise Library, worked through the installation process and it still doesn't work. Did I install it to the wrong location? Any ideas?

Edit: I followed Kev's directions and got everything working. Thanks for your guys' help.

like image 725
LoganFrederick Avatar asked Jul 10 '09 17:07

LoganFrederick


People also ask

How do I add Microsoft practices EnterpriseLibrary data reference?

1 Select Start > Programs > Microsoft patterns and practices > Enterprise Library 6.0 > Enterprise Library Configuration. The Enterprise Library Configuration window appears. 2 Select File > New Application. 3 Right-click the Application Configuration node and select New > Logging Application Block.

What is the use of Microsoft Enterprise Library?

Microsoft Enterprise Library is a collection of reusable application blocks designed to assist software developers with common enterprise development challenges.

How do I open Microsoft Enterprise Library console?

Please follow the configuration steps below:Right click on the App. config >> Open with Enterprise Library Application Block Console. If it is not available in the list, you can add it manually by clicking on the Add button. We can log the messages in different file types.


2 Answers

You need to add references in your project to:

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

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

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

You can locate the assemblies you need to reference in:

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

These assemblies are also listed in the Add References (.NET) dialogue:

Enterprise Library Data Access Application Block
Enterprise Library Shared Library

like image 175
Kev Avatar answered Oct 07 '22 22:10

Kev


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

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

From that article, you also need a few other references:

  • Add a reference to the Data Access Application Block assembly. In Visual Studio, right-click your project node in Solution Explorer, and then click Add References. Click the Browse tab, and then navigate to the location of the Microsoft.Practices.EnterpriseLibrary.Data.dll assembly. Select the assembly, and then click OK to add the reference.

  • Following the same procedure, add references to the Enterprise Library Core assemblies, Microsoft.Practices.EnterpriseLibrary.Common.dll and Microsoft.Practices.ObjectBuilder2.dll.*

Let us know how you made out.

like image 40
rifferte Avatar answered Oct 07 '22 20:10

rifferte