artem-zinnatullin / jet-image-loader

WP7+ fast and powerfull image loader with memory and storage caching for your projects!
Apache License 2.0
44 stars 14 forks source link

[wp7] IsoStorageException "An error occured while accessing IsoStorage" #18

Closed ghost closed 10 years ago

ghost commented 10 years ago

http://clip2net.com/clip/m0/1384008861-clip-47kb.png

Appears on Lumia 800.

Callstack: System.IO.IsolatedStorage.IsolatedStorageException occurred Message=An error occurred while accessing IsolatedStorage. StackTrace: at System.IO.IsolatedStorage.IsolatedStorageFile.GetLastAccessTime(String path) at JetImageLoader.Cache.Storage.CacheImpl.LimitedStorageCache.b7() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() at System.Threading.Tasks.Task.ExecuteWithThreadLocal() at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution) at System.Threading.Tasks.TaskScheduler.TryExecuteTask(Task task) at System.Threading.Tasks.ThreadPoolTaskScheduler.<.ctor>b0(Object state) at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadPool.WorkItem.doWork(Object o) at System.Threading.Timer.ring()

ghost commented 10 years ago

Checked my test project (that kinda works) with debugger. _lastAccessTimeDictionary contains 0 as values (last access time). Can you check that on your side?

Another think is that exception is not catched there. Probably, because using is inside of try-cath. But i'm not sure.

artem-zinnatullin commented 10 years ago

I have not got wp7 phone or sdk. MSDN says that IsolatedStorageException could occur when The isolated store has been removed. -or- Isolated storage is disabled.

IsolatedStorageFile.GetLastAccessTime

Can you check property IsolatedStorageFile.IsEnabled?

ghost commented 10 years ago

Actually, whole process is looking a bit strange. I always used it like

using (var isoFiles = IsolatedStorageFile.GetUserStoreForApplication())

You're using just IsolatedStorageFile, and it works :) Also, there's no ISF.IsEnabled. I'm using it in

using (var file = ISF.OpenFile(fullCacheFilePath, FileMode.Open, FileAccess.Read)) { cacheSizeInBytes += file.Length;

                        var t = ISF.GetLastAccessTime(cacheFileName).Millisecond;

                        var b = ISF. // IsEnabled is not here

                        JetImageLoader.Log("Size of " + cacheFileName + " is " + t);

                        _lastAccessTimeDictionary.Add(fullCacheFilePath,
                            ISF.GetLastAccessTime(cacheFileName).Millisecond);
                    }
Nearga commented 10 years ago

You can close this either :)