0

We are using microsoft enterprise caching library 5.0.414.0 version for caching some DB data to Isolated storage

After abrupt power shutdown of the system, we are facing that reading cache is failing.

To be specific CacheFactory.GetCacheManager("Cameras") is failing with below exception

Inner exception is-Microsoft.Practices.Unity.ResolutionFailedException: Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager", name = "Cameras". 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 - Binary stream '0' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.

Only way to recover is to delete the Isolated storage manually and restart the application.

Since Isolated storage goes into appdata folder, during windows disk repairing whether is there any chance of cache files getting corrupted ?

Is there any other way to identify this corruption and remove the cache files, so that our application will recreate it ?

Since CacheFactory.GetCacheManager("Cameras") is failing not sure how to handle it ?

0 Answers0