Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching ?

Topics: Caching Application Block
Nov 2, 2012 at 4:25 PM
Edited Nov 2, 2012 at 4:46 PM

The cache.dll has a verion of 5.0.505.0

When I run a program, I see this error below. What am I missing ?

Thanks, Peter

 

{"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

 


The app config contains this:

  <enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
    <sources>
      <add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="EntLib Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        filePath="EntLib.config" />
    </sources>
    <redirectSections>
      <add sourceName="EntLib Configuration Source" name="cachingConfiguration" />
      <add sourceName="EntLib Configuration Source" name="loggingConfiguration" />
    </redirectSections>
  </enterpriseLibrary.ConfigurationSource>

 

The entlib.config contains this:

  <cachingConfiguration defaultCacheManager="CacheManager">
    <cacheManagers>
      <add name="CacheManager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000"
        numberToRemoveWhenScavenging="10" backingStoreName="NullBackingStore" />
    </cacheManagers>
    <backingStores>
      <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="NullBackingStore" />
    </backingStores>
  </cachingConfiguration>

Nov 2, 2012 at 5:25 PM
petercli wrote:

The cache.dll has a verion of 5.0.505.0

When I run a program, I see this error below. What am I missing ?

Thanks, Peter

 

{"Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.":"Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

 


The app config contains this:

  <enterpriseLibrary.ConfigurationSource selectedSource="System Configuration Source">
    <sources>
      <add name="System Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.SystemConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add name="EntLib Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        filePath="EntLib.config" />
    </sources>
    <redirectSections>
      <add sourceName="EntLib Configuration Source" name="cachingConfiguration" />
      <add sourceName="EntLib Configuration Source" name="loggingConfiguration" />
    </redirectSections>
  </enterpriseLibrary.ConfigurationSource>

 

The entlib.config contains this:

  <cachingConfiguration defaultCacheManager="CacheManager">
    <cacheManagers>
      <add name="CacheManager" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="1000"
        numberToRemoveWhenScavenging="10" backingStoreName="NullBackingStore" />
    </cacheManagers>
    <backingStores>
      <add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="NullBackingStore" />
    </backingStores>
  </cachingConfiguration>


OK - I answered my own question. The previous dev did not add refernces to dlls that were unity injection loaded.