ObjectBuilder2

Topics: Caching Application Block
Jun 16, 2008 at 6:58 AM
I am creating an application where i use Enterprise Library Cache, I need to reference Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll as per the MSDN article http://msdn.microsoft.com/en-us/library/cc511707.aspx i have installed Enterprise Library 4.0 - May 2008. but i could not find this dll anywhere, instead i found Microsoft.Practices.ObjectBuilder2.dll .
I am wondering which one is correct, even if i reference the later one still m getting the following exception in my application. 

{System.TypeInitializationException: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory..cctor()

I have already reference Microsoft.Practices.EnterpriseLibrary.Common.dll

my concern are the following dlls same or two different
Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll  AND  Microsoft.Practices.ObjectBuilder2.dll

Jun 16, 2008 at 4:28 PM
Hi,

There is no Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll assembly; documentation is incorrect in that regard.

From what I can tell you've encountered the issue described by Tom in his post about avoiding configuration pitfalls.

Fernando



ali_sofi wrote:
I am creating an application where i use Enterprise Library Cache, I need to reference Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll as per the MSDN article http://msdn.microsoft.com/en-us/library/cc511707.aspx i have installed Enterprise Library 4.0 - May 2008. but i could not find this dll anywhere, instead i found Microsoft.Practices.ObjectBuilder2.dll .
I am wondering which one is correct, even if i reference the later one still m getting the following exception in my application. 

{System.TypeInitializationException: The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory' threw an exception. ---> System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Microsoft.Practices.EnterpriseLibrary.Common, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory..cctor()

I have already reference Microsoft.Practices.EnterpriseLibrary.Common.dll

my concern are the following dlls same or two different
Microsoft.Practices.EnterpriseLibrary.ObjectBuilder2.dll  AND  Microsoft.Practices.ObjectBuilder2.dll




Dec 31, 2008 at 4:37 AM
Hi,

Remove all the dlls and add the following from :

C:\Program Files\Microsoft Enterprise Library 4.0 - May 2008\ Bin folder :

1. Microsoft.Practices.EnterpriseLibrary.Caching
2. Microsoft.Practices.EnterpriseLibrary.Caching.Database
3. Microsoft.Practices.EnterpriseLibrary.Common
4. Microsoft.Practices.EnterpriseLibrary.Data

Using the Enterprise library tool create a Caching block with default values and save them as App.config.

It works fine.

Many Thanks
Krish