Pregunta

It sounds like "An error occurred while accessing IsolatedStorage". But there's no such exceptions is msdn: http://msdn.microsoft.com/en-us/library/system.io.isolatedstorage.isolatedstoragefile.getlastaccesstime(v=vs.110).aspx

I assume, it can be because i'm calling it inside of Task.Factory.StartNew(). Can it be a reason? It works on wp8 fine.

EDIT:

The problem was that I used GetLastAccessTime(cacheFileName).Millisecond; As it is said by the link by Agat, miliseconds are always 0 at the wp7. Or, actually, they are even not available, because exception is throwing while trying to access them. So just dont use Milliseconds, and that's it.

¿Fue útil?

Solución

If you just asking if it can be? I would rather answer that "yes, it can", and generally, because of the following:

To synchronize access to the local folder between different threads, we recommend using the Mutex class. A mutex grants exclusive access to a shared resource to only one thread. If one thread acquires a mutex, the second thread that wants to acquire that mutex is suspended until the first thread releases the mutex. For example, a mutex could be used to synchronize access to a folder between a Windows Phone app running in the foreground and a background agent.

But from other hands, if the exception occurs constantly, there might be a number of other reasons. Please have a look at this link, which can give you a clue about some specific things of GetLastAccessTime method work on Windows Phone 7.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top