Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
9 views
in Technique[技术] by (71.8m points)

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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 FilesMicrosoft Enterprise Library 4.1 - October 2008

You can locate the assemblies you need to reference in:

C:Program FilesMicrosoft Enterprise Library 4.1 - October 2008Bin

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

Enterprise Library Data Access Application Block
Enterprise Library Shared Library


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...