Application caching block

Topics: Caching Application Block
Nov 23, 2011 at 10:20 AM

I created a partition called "mycache" when I RUN the application for the first time, there are no errors and i get the result.
I use database to persist the cache.

now when i stop the application and rerun i get this error........

could some one help??


Microsoft.Practices.ServiceLocation.ActivationException was caught
  Message=Activation error occured while trying to get instance of type ICacheManager, key "CacheManager"
  Source=Microsoft.Practices.ServiceLocation
  StackTrace:
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 53
       at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 103
       at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.InnerGetCacheManager(String cacheManagerName) in e:\Builds\EntLib\Latest\Source\Blocks\Caching\Src\Caching\CacheFactory.cs:line 66
       at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager(String cacheManagerName) in e:\Builds\EntLib\Latest\Source\Blocks\Caching\Src\Caching\CacheFactory.cs:line 53
       at Chempoint.Infrastructure.Caching.CacheManager.IsExistsInCache(CacheKey key) in D:\Bedrock\For review Nov21\CPEnterprise\Core\Infrastructure\Caching\CacheManager.cs:line 27
  InnerException: Microsoft.Practices.Unity.ResolutionFailedException
       Message=Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager", name = "CacheManager".
Exception occurred while: Calling constructor Microsoft.Practices.EnterpriseLibrary.Caching.Cache(Microsoft.Practices.EnterpriseLibrary.Caching.IBackingStore backingStore, Microsoft.Practices.EnterpriseLibrary.Caching.Instrumentation.ICachingInstrumentationProvider instrumentationProvider).
Exception is: SerializationException - Unable to find assembly 'ChempointDataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
-----------------------------------------------
At the time of the exception, the container was:

  Resolving Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager,CacheManager (mapped from Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager, CacheManager)
  Resolving parameter "realCache" of constructor Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager(Microsoft.Practices.EnterpriseLibrary.Caching.Cache realCache, Microsoft.Practices.EnterpriseLibrary.Caching.BackgroundScheduler backgroundScheduler, Microsoft.Practices.EnterpriseLibrary.Caching.ExpirationPollTimer pollTimer)
    Resolving Microsoft.Practices.EnterpriseLibrary.Caching.Cache,CacheManager
    Calling constructor Microsoft.Practices.EnterpriseLibrary.Caching.Cache(Microsoft.Practices.EnterpriseLibrary.Caching.IBackingStore backingStore, Microsoft.Practices.EnterpriseLibrary.Caching.Instrumentation.ICachingInstrumentationProvider instrumentationProvider)

       Source=Microsoft.Practices.Unity
       NameRequested=CacheManager
       TypeRequested=ICacheManager
       StackTrace:
            at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
            at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, String name, IEnumerable`1 resolverOverrides)
            at Microsoft.Practices.Unity.UnityContainer.Resolve(Type t, String name, ResolverOverride[] resolverOverrides)
            at Microsoft.Practices.Unity.UnityServiceLocator.DoGetInstance(Type serviceType, String key)
            at Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key) in c:\Home\Chris\Projects\CommonServiceLocator\main\Microsoft.Practices.ServiceLocation\ServiceLocatorImplBase.cs:line 49
       InnerException: System.Runtime.Serialization.SerializationException
            Message=Unable to find assembly 'ChempointDataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
            Source=mscorlib
            StackTrace:
                 at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
                 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
                 at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
                 at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
                 at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
                 at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
                 at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
                 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
                 at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)
                 at Microsoft.Practices.EnterpriseLibrary.Caching.SerializationUtility.ToObject(Byte[] serializedObject) in e:\Builds\EntLib\Latest\Source\Blocks\Caching\Src\Caching\SerializationUtility.cs:line 58
                 at Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore.DeserializeValue(DataRow dataToLoad)
                 at Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore.CreateCacheItem(DataRow dataToLoad)
                 at Microsoft.Practices.EnterpriseLibrary.Caching.Database.DataBackingStore.LoadDataFromStore()
                 at Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.BaseBackingStore.Load() in e:\Builds\EntLib\Latest\Source\Blocks\Caching\Src\Caching\BackingStoreImplementations\BaseBackingStore.cs:line 157
                 at Microsoft.Practices.EnterpriseLibrary.Caching.Cache..ctor(IBackingStore backingStore, ICachingInstrumentationProvider instrumentationProvider) in e:\Builds\EntLib\Latest\Source\Blocks\Caching\Src\Caching\Cache.cs:line 46
                 at BuildUp_Microsoft.Practices.EnterpriseLibrary.Caching.Cache(IBuilderContext )
                 at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.BuilderContext.NewBuildUp(NamedTypeBuildKey newBuildKey)
                 at Microsoft.Practices.Unity.ObjectBuilder.NamedTypeDependencyResolverPolicy.Resolve(IBuilderContext context)
                 at BuildUp_Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager(IBuilderContext )
                 at Microsoft.Practices.ObjectBuilder2.DynamicMethodBuildPlan.BuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.BuildPlanStrategy.PreBuildUp(IBuilderContext context)
                 at Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)
                 at Microsoft.Practices.Unity.UnityContainer.DoBuildUp(Type t, Object existing, String name, IEnumerable`1 resolverOverrides)
            InnerException:

Nov 23, 2011 at 10:23 PM

Based on your stacktrace it looks like there is an error locating your assembly:

Exception is: SerializationException - Unable to find assembly 'ChempointDataAccess, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

Verify the assembly information is correct and that the asssembly and all its dependencies are resolvable by the runtime.  To help track down the problem you can use the Assembly Binding Log Viewer to track down any binding failures.

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com