Library version queries with .Net version compatibility

Topics: General discussion
Oct 20, 2011 at 10:26 AM

Hi Team,

I have Web application developed in .Net framework 2,0 with Visual Studio 2005 which uses Microsoft.Practices.EnterpriseLibrary module.

I have used release package Microsoft Enterprise Library 4.0 - May 2008 - (Enterprise Library 4.0 – May 2008 (for .NET Framework 3.5 and Visual Studio 2008).

I have referenced  Microsoft.Practices.EnterpriseLibrary.Data.dll, Microsoft.Practices.EnterpriseLibrary.Common.dll. In the properties of this dll , "Sepcific Version" property is set to "False". With these settings i could use the dll functions in my code.

But, when i migrated this application to VS 2010 environment keeping the target framework of application same as 2.0. It throws me error while using this dll. Error thrown as "Error The type or namespace name 'EnterpriseLibrary' does not exist in the namespace 'Microsoft.Practices' (are you missing an assembly reference?)"  

Can anyone help to resolve this issue. Is there any specific reason behind this scenario when we migrated to higher version?

Since, in VS 2005, I can still reference Enterprise dll compatible for 3.5 .net framework and I can use them as well. But this is not happening with VS 2010 as environment and keeping 2.0 .net versions.

 
 
Many Thanks
 

 

 

Oct 21, 2011 at 2:34 AM

Enterprise Library 4.0 requires .NET 3.5.  So if you try to target the .NET 2.0 runtime you will get a compilation error: 

'Microsoft.Practices.EnterpriseLibrary.Common.dll', or one of its dependencies, requires a later version of the .NET Framework than the one specified in the project.

You need to target at least .NET 3.5.

 

-- Randy