Problem with Microsoft.Practices.EnterpriseLibrary.Data.dll

Topics: Data Access Application Block
Apr 25, 2010 at 11:12 PM
Edited Apr 25, 2010 at 11:13 PM

I have the evaluation Version of Visual Studio 2010, When I installed Entlib 5, All dll's have been installed correctly except the Microsoft.Practices.EnterpriseLibrary.Data.dll was not accessible in . NET tab.

I have to reference it using the browse..

When I try to write such code : 

Database db = DatabaseFactory.CreateDatabase("csSql");

the intellisence propose to add the correct using :

using Microsoft.Practices.EnterpriseLibrary.Data;

but when I compile, i have some errors : 

 

The name 'DatabaseFactory' does not exist in the current context

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

The type or namespace name 'Database' could not be found (are you missing a using directive or an assembly reference?)

 

and the word data in the using is highlighted in Red, it didn't recognizes the data namespace:

using Microsoft.Practices.EnterpriseLibrary.Data;

 

-I tried to change the specific version of the data dll into TRUE.

-I have referenced all Entlib dlls.

-I tried entlib5 with VS2008 and it works correctly.

 

Apr 26, 2010 at 12:22 AM

This thread should help -http://entlib.codeplex.com/Thread/View.aspx?ThreadId=209699

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com

Apr 26, 2010 at 3:30 AM

To short circuit digging through that other thread - the Data block only works if you target the full .NET framework. By default, client projects in VS 2010 target the .NET Client profile. Go into your project properties and change your target framework to .NET Framework 4.0 instead of client profile and it should work.

 

Apr 26, 2010 at 8:32 AM

Thanks for help, it works Correctly after changing the target to .NET Framework 4.0 instead of client profile.

May 10, 2010 at 5:34 AM
ctavares wrote:

To short circuit digging through that other thread - the Data block only works if you target the full .NET framework. By default, client projects in VS 2010 target the .NET Client profile. Go into your project properties and change your target framework to .NET Framework 4.0 instead of client profile and it should work.

 

Thank you ct for short cicuiting that post.

I always amazed by people who know the answer to a simple question but believe it is more helpful to point them to a 3000 word post.

Avande and Ms. Urmeneta go on my DO NOT HIRE list